turn off select...sometimes
turn off select...sometimes
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
RequestRoleSelectTable
.rows(function (idx, data, node) {
if (headerID == 0) {
return data.Users.UserID != null ? false : true;
} else {
return data.RequestDetails.RequestDetailID != null ? false : true;
}
})
.remove().draw();
RequestRoleSelectTable.select(false);
} else {
btnText = 'Save'; //updating existing request
}
}
This question has accepted answers - jump to:
This discussion has been closed.
Answers
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. Theselect.selectorshows the default astd, th. You could turn it back on by using this selector.Kevin
Yep, Kevin's right. I'd just knocked out this example before I realised he'd replied and said the same thing!
Colin
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.