responsive toggle always trigger select

responsive toggle always trigger select

t0n1zzt0n1zz Posts: 32Questions: 19Answers: 0

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

  • kthorngrenkthorngren Posts: 21,260Questions: 26Answers: 4,932

    You can use select.selector to control which columns are used for row selection.

    Maybe try selector: 'td:not(:first-child)'.

    Kevin

  • t0n1zzt0n1zz Posts: 32Questions: 19Answers: 0

    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?

  • kthorngrenkthorngren Posts: 21,260Questions: 26Answers: 4,932
    Answer ✓

    Maybe try:
    selector: 'td:not(:last-child)'

    Notice the addition of td: in front of :not.

    Kevin

  • t0n1zzt0n1zz Posts: 32Questions: 19Answers: 0

    oh okay thank you for your help, now it works perfectly

This discussion has been closed.