Selected row
Selected row
Andreas S.
Posts: 207Questions: 73Answers: 4
in Select
I use this script to enable some buttons if a row is selected:
ulist.on('select', function () {
var selectedRows = ulist.rows( { selected: true } ).count();
ulist.button( 1 ).enable( selectedRows === 1 );
ulist.button( 2 ).enable( selectedRows === 1 );
ulist.button( 3 ).enable( selectedRows === 1 );
});
If the Page with the Table is new loaded, the Button are disabled. If I select a row the buttons are enabled.
I deselect the row, the buttons should now disabled again, but the Button are enabled and create an error if
you click on the Button without selection. How can I disable the button if the user have deselected all rows?
Andreas
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Use the
deselect
event andbutton().disable()
. Basically the exact inverse of what you have above.Allan