How do I prevent the Remove button from enabling only for certain rows based on row content?
How do I prevent the Remove button from enabling only for certain rows based on row content?
I am using the Editor extension with Edit, Remove, and New buttons. When one or more rows are selected, I want to always Edit but not necessarily Remove the selected rows, based on a column value. I think I need to override an event a row is selected, examine the row content to see whether or not to enable the Remove button---something along those lines. But I also want to do the default behavior when a row is selected (i.e. enable the Edit button, highlight the row, and whatever else may be happening).
This question has an accepted answers - jump to answer
Answers
I figured out a solution for myself. Including a code snippet in case it helps someone else:
Thanks for posting back - that looks just about perfect. The only change I would suggest is to add a listener for the
select
event which will perform the logic check required and either enable or disable the button as needed.This is how Select's built in buttons use the
init
option to add a suitable listener.Allan