Trigger on deselection of QTable rows
I looked at the QTable API and I could not find a trigger that I can call upon deselection of the rows. I’m trying to enable/disable a Delete button depending if a row is selected however when a user checks a box on a row but then unchecks that same box, I don’t have a trigger such as “selected-rows-label” function to disable the Delete button again.
Here’s a code snippet:
Is there a function I take advantage that trigger on deselection of checkboxes?
@Mak-NOAA just do an inverse assignment on your event handler ie.
props.selected = !props.selected.
@metalsadman sorry not following here…so I have this line:
where I call “getSelectedString” function upon “selected-rows-label” , then that function decides if there’s anything checked to make sure to enable the Delete button. However when I uncheck a box, the “getSelectedString” doesn’t get called, so how do trigger some function upon unchecking? Not sure how to inverse the call to “getSelectedString”.
@metalsadman any thoughts here before you sleep?
@Mak-NOAA there might be a better way. See the qtable api card at events and methods part. Theres this
isRowSelectedmethod that take’s your qtable’s rowkey to select that specific row. Give your qtable a ref then you can
Thanks @metalsadman I’m gonna try isRowSelected
@metalsadman I implemented the method isRowSelected but how do I get it called isRowSelected?
nothing is being spit out on the dev console upon selection or deselection.
I need the event to be upon deselection so there’s now key here.
I need something in the
is that “deselection” possible? and what is that event?
@Mak-NOAA see my pr on your repo.
Thanks @metalsadman that fixed it, thank you, I didn’t know
was an event.