Is there an event in Lightswitch html tables to intercept selected row change

StackOverflow https://stackoverflow.com//questions/24047068

  •  21-12-2019
  •  | 
  •  

質問

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.

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top