responsive toggle always trigger select
responsive toggle always trigger select
so i am using responsive and select extension together. and i am building user selection form that using datatable to show all user available in database. when i select user from datatable, the selected user information will be added/append into html element above datatable to tell user that this user is selected and added.
the problem come when i also integrating responsive that will create a toggle that if i click it will show detailed information (child row) that i don't or can't show all into single row table. But by clicking this toggle not only it will show detailed information (child row) but also trigger select extension and automatically add/append these user into html element above datatable.
so how to disable select when i click responsive toggle? and only trigger select when i click other column beside responsive toggle column?
i have come in mind by using checkbox feature in select, but it is now very practical and not so user friendly since click area are rather small or maybe i can change these checkbox into something like "add" button?
This question has an accepted answers - jump to answer
Answers
You can use
select.selector
to control which columns are used for row selection.Maybe try
selector: 'td:not(:first-child)'
.Kevin
well i have my responsive toggle in the end of the column so i tried
selector: ':not(:last-child)'
but what i get is all other column is not selector and only the last one is selector... kinda confusing since the documentation say "Allow selection on all but the last column" or i do missing something here?Maybe try:
selector: 'td:not(:last-child)'
Notice the addition of
td:
in front of:not
.Kevin
oh okay thank you for your help, now it works perfectly