Get seletion value
Get seletion value
DotCom
Posts: 2Questions: 1Answers: 0
Im trying to get if a row is selected (most likely expecting true or false).
Im identifying my row using this table.row('#1')
Is there an extension available to check if this row is selected or not?
I searched in the documentation and online forums, including this one, but found nothing. Please point me to any related post or just mention the extention. Thanks
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
several ways but the most straight forward is probably
assuming the row id is "1"...
$(table.row("#1").node()).hasClass("selected");j
or to get the selected row (assuming single select)
table.row(".selected");
Thank you!
I was thinking of a more straigt forward way using the API instead of relying on the css class. But that works too.
is how to do it with the API. That basically does an AND between the row selector ('#1') and the row selector modifier (
{selected: true}
) - usingany()
to return a boolean value based on what was found.Allan