Individual column filtering server side - data column index is not correct
Individual column filtering server side - data column index is not correct
I implement the individual column filtering as the following link - https://datatables.net/extensions/fixedcolumns/examples/styling/col_filter.html
table.columns().every( function (colIdx) {
var that = this;
$( 'input', $("#individualfilter th") ).on( 'keyup change', function (e) {
e.stopPropagation();
if ( that.search() !== this.value ) {
var data = that
.columns(this.accessKey)
.search( this.value )
;
that .draw();
}
} );
} );
but when I do filter in each column, it will filter previous column and filter function does not work in last column.
How do I debug it ?
Please see the below images.
Answers
Hi STKenneth
I believe when searching columns by index you have to refer to the column starting from 1 not 0.
So if you wanted to select the last column from the image you posted you would use 4 not 3 as menu is a column as well.
Thanks,
Tom
Hello Tom,
Thank you for your reply.
In my second photo, I have tried to use 3 in columns and then do search but it does not work. How do I debug that? Is there any way to check that.
Hello Tom
Please see the photo. Search function did not work for the last column
https://goo.gl/photos/UMxakt5dp74BXRpg7
My code
Hello Tom,
I think I already solve this issue after upgrading to 1.10.12.
The previous version is 1.10.8.
Thank you for your reply.
Hi Kenneth
Thanks for the update, glad you got it working.
Tom