Is there any way to make certains rows unselectable for an 'multi-selecting' table tools

Is there any way to make certains rows unselectable for an 'multi-selecting' table tools

machinariummachinarium Posts: 17Questions: 0Answers: 0
edited July 2013 in General
Hi,
As titles. Is there any way to make some rows unselectable for an 'multi-selecting' table tools?

@Alan, thanks for your such an amazing table tool. I will never hesitate to give you all my respect.

Thanks,
Arthur

Replies

  • machinariummachinarium Posts: 17Questions: 0Answers: 0
    This requirement should be normal. For example, some rows are reserved for only viewing, not editable. So I wanna make it unselectable to avoid users mistakenly select it and do something wrong with selected rows.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    > Is there any way to make some rows unselectable for an 'multi-selecting' table tools?

    Yes - use the fnPreRowSelect ( http://datatables.net/extras/tabletools/initialisation ) function. You can perform a logic test to deny some rows from being selected.

    > @Alan, thanks for your such an amazing table tool.

    Thank you :-)

    Regards,
    Allan
  • machinariummachinarium Posts: 17Questions: 0Answers: 0
    Thanks great for your help. It works.
  • machinariummachinarium Posts: 17Questions: 0Answers: 0
    I tried, and it worked. However, it has side-effects. This piece of [code]"fnPreRowSelect": function ( e, nodes ) {
    if ( e.currentTarget.className.indexOf('no_select') != -1 ) {
    return false;
    }
    return true;
    }[/code] will fail due to e is undefined when selecting all. So how to deal with this kind of issues? thanks.
This discussion has been closed.