Tables Columns Search Boxes: reduce the number of draw.
Tables Columns Search Boxes: reduce the number of draw.
Greeko
Posts: 4Questions: 1Answers: 0
I like to mention what I have entered below is non-functional, but I hoping someone will get on what I wanting to achive and give me a hint at sytax that is needed. I like to reduce the number of draw done when
muliple value have been entred to the column search boxes. Is the below possiable, beside the horrble sytax I had entered.
initComplete: function () {
self = this.api();
var srchinput = $('.dataTables_filter input').unbind();
$searchButton = $('<button class="searchButtoncall ui-button">').text('Search').click(function() {
self.search(srchinput.val()).draw();
var ar_footer_idx = [];
var ar_footer_val = [];
self.columns().every( function ( idx ) {
ar_footer_idx[idx] = idx;
ar_footer_val[idx] = '"' + $(this.footer()).find('input').val() + '"';
});
var st_footer_idx = ar_footer_idx.join();
var st_footer_val = ar_footer_val.join();
eval('$oTable.columns(' + st_footer_idx + ').search((' + st_footer_val + '), true, false).draw();');
// Example after eval.
//$oTable.columns(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20).search(("","CENTRAL","CL","","","","","","","","","","","","","","","","","",""), true, false).draw();
});
}
This question has an accepted answers - jump to answer
Answers
Take this column search example and remove the
.draw();
on line 19. Then use a button that when clicked callsdraw()
. This will execute the column searches.Line 18 won't work because there issn't a mechanism to create an array of search terms in
search()
that will map to the array of columns incolumns()
.Kevin
Thank you Kevin, that work out great.