turn off select...sometimes

turn off select...sometimes

montoyammontoyam Posts: 568Questions: 136Answers: 5

I have a dataTable where I need to enable select

        select: {
            style: 'multi'

but, under certain conditions I need to turn off the ability to select. Is this possible?

I tired .select(false) but that didn't seem to work

        if (isNewRequest == 0) {
            if (selected.data().RequestHeader.ApprovedBy != null) {
                btnText = 'Close'; //no changes allowed
                    .rows(function (idx, data, node) {
                        if (headerID == 0) {
                            return data.Users.UserID != null ? false : true;
                        } else {
                            return data.RequestDetails.RequestDetailID != null ? false : true;

            } else {
                btnText = 'Save'; //updating existing request

This question has accepted answers - jump to:


  • kthorngrenkthorngren Posts: 19,891Questions: 26Answers: 4,691
    Answer ✓

    I might be wrong but I don't think there is an API to toggle select on/off. However you could use select.selector() to set a fake classname to turn it off. The select.selector shows the default as td, th. You could turn it back on by using this selector.


  • colincolin Posts: 15,094Questions: 1Answers: 2,581
    Answer ✓

    Yep, Kevin's right. I'd just knocked out this example before I realised he'd replied and said the same thing!


  • montoyammontoyam Posts: 568Questions: 136Answers: 5

    you guys are awesome!!

    I can not talk enough about DataTables and the support you provide. I recommend it to others every chance I get.

Sign In or Register to comment.