filtering and table-id
filtering and table-id
Ficos
Posts: 88Questions: 22Answers: 0
Filtering my table with this function:
$.fn.dataTable.ext.search.push( function ( settings, searchData, index, rowData, counter ) {
if(
(((btnArchief==0) && (searchData[1]=='0')) || ((btnArchief==1) && (searchData[1]=='1'))) &&
(((btnRelatie==0) && (searchData[2]=="0")) || ((btnRelatie==1) && (searchData[2]=="1")))
){
return true;
}
return false;
};
});
When there are more than 1 table on the page, this filtering will occur on ALL tables. So I need to identify each table. In Version 9 i could identify the table with :
if ( oSettings.nTable.id == 'client05' ) {
so I presume that the table id will be found in settings.
Can you please tell me where I can find the values of "settings" and how to use them?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You can do that in 1.10 as well.
Its not ideal I know, but that should still work.
Allan
It doesn't work:
Still I wonder where I can find the information about 'settings' in the search functions.
Have you checked your browser's console? I'd be surprised if there isn't an error there stating that
oSettings
is undefined. It is - you've called the settings parametersettings
in the argument list. They should match.You won't find it anywhere. For the most part the settings object is private. This is the one exception since that information can't easily be obtained via the API. That will change with the next major update.
Allan