You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a table with selection check boxes enabled.
My problem is that I do not really want the check boxes to appear on every row. So, dependent on the value in a particular column, I would like the checkbox to be either not present, or disabled.
In practice (because of the nature of the data) this will actually be every alternate row, so a "cheat" could be just to enable on alternate rows rather than by column value.
Is there a way that I can achieve this behaviour?
Thanks
Norman B
The text was updated successfully, but these errors were encountered:
You can use the recordsLoaded event, which executes when the DOM for the html table has been constructed so that you can manipulate rows depending on the record data.
Here is a template for you
recordsLoaded: function(event, data) { // executes when tha table is added to the dom before ndisplaying
// NOTE. $(this) => "div#PeopleTableContainer(n)
$(this).find('tbody tr').each(function () {
record = $(this).data('record');
if (record.your_field) == your_test ) {
var td = $(this).find('td.jtable-selecting-column');
td.attr('title','Selection disabled because your_reason'); // optional to show why disabled
td.find('input').attr('disabled', true);
}
});
$(this).tooltip();
}
Just edit your_field, your_test and your_reason to make it suitable for your context.
I have a table with selection check boxes enabled.
My problem is that I do not really want the check boxes to appear on every row. So, dependent on the value in a particular column, I would like the checkbox to be either not present, or disabled.
In practice (because of the nature of the data) this will actually be every alternate row, so a "cheat" could be just to enable on alternate rows rather than by column value.
Is there a way that I can achieve this behaviour?
Thanks
Norman B
The text was updated successfully, but these errors were encountered: