Skip to content

Instantly share code, notes, and snippets.

@cgillis-aras
Created January 16, 2019 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgillis-aras/408ea18de5990e0a214ec97398b86b82 to your computer and use it in GitHub Desktop.
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
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