removing a row / redrawing table doesn't update row count
removing a row / redrawing table doesn't update row count
Vexiphne
Posts: 3Questions: 0Answers: 0
How can I get the row count to update when you delete rows from a datatable ?
This discussion has been closed.
Replies
If you aren't using server-side processing, please link me to a test page so I can see the issue.
Allan
Here's an example (#issueBody is the table's );
[code]
// Since ddlPriority is data base driven, dynamically build class selectors
var $priority0 = $('tr', '#issueBody');
var priorities = { priority0: $priority0 };
$("#ddlPriority > option").each(function () {
if ($(this).attr('class') != 'priority0') {
var style = $(this).attr('class');
var $tr = $('tr.' + style, '#issueBody');
priorities[style] = $tr;
}
});
$('#ddlPriority').change(function (e) {
e.preventDefault();
var select = e.target;
var option = select.options[select.selectedIndex];
var filter = $(option).attr('class');
$priority0.addClass('priorityFilter');
priorities[filter].removeClass('priorityFilter');
});
[/code]
The priorityFilter class is simply display: none. The options are priority0, priority1... priority[n] based on a database table's values. There's another one that does the same thing, so the filtering of both are applied to the table.
How can I get the table row count to update when I perform this filtering? Is there a better way to do this to be compatible with DataTables?
Thanks!
Jason