Reputation: 389
I want to put a Delete button on my Screen whose state depends on if a row is selected in the Screen and some other conditions... basically I want to let the user be able to delete the current selected item, the problem here is that I can't find an appropriate event in the table to add custom logic when a new row becomes active.
Upvotes: 0
Views: 649
Reputation: 278
In the delete button's _canExecute() method just put the following code:
myapp.MyScreen.DeleteButton_canExecute = function (screen) {
return screen.Orders.selectedItem != null;
};
You can also control whether the button is visible when disabled by checking or unchecking the "Hidden if disabled" checkbox in the properties for the selected button.
Upvotes: 2