Created
January 16, 2019 15:56
-
-
Save cgillis-aras/408ea18de5990e0a214ec97398b86b82 to your computer and use it in GitHub Desktop.
Sample code for Aras Innovator to enable/disable a CUI button based on the items selected in the grid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (inArgs.isReinit) { | |
var topWindow = aras.getMostTopWindowWithAras(window); | |
var workerFrame = topWindow.work; | |
if (workerFrame && workerFrame.grid && workerFrame.grid.getSelectedItemIds().length > 1) | |
{ | |
return { "cui_disabled": false }; // enable the button | |
} | |
else | |
{ | |
return { "cui_disabled": true }; // disable the button | |
} | |
} | |
return {}; // keep the current state of the button |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment