javascript - How to apply filter to specific datatable -
Is it possible to apply only one data to a fixed filter? I have the following filter function which I am applying for preparing a document, I do not know that this is a proper process, but will be affected by all the datatable filters as a side effect. I would like to influence only $ ('# ProductTable'), but this selector does not seem to have the desired effect.
// Filters function in stock $ / $ ('# ProductTable') $ .fn.dataTableExt.afnFiltering.push (function (oSettings, aData, iDataIndex) {var check = $ ('# instock'). (': Check'); var qntStock = 1; var stock call = 3; if (! Check) {back true;} if (checked & amp; adata [stockcall]> qntStock) {return true;} return false;}); Is it possible to apply a filter only to a particular table? Datasetable initialization:
var oTable = $ ('# ProductTable'). DotTable ("AO column defects": [{"sClass": "my_class", "aTargets": [4]}], "Botwoth": incorrect, "iDisplayLength": 100, "fnDrawCallback": function () {$ ("Td.my_class"). Values (function (value, settings) {return (value);}, {pointers: 'save ...', tooltip: 'click to edit ...'}); }}); You can create an array of tables for filters - then check your filters. If the current table is present in that array ... something like this: // Set an array of IDs of tables which should be allowed by the Var permission filter [[productTable]]; $ .fn.dataTableExt.afnFiltering.push (function (oSettings, aData, iDataIndex) {// Check that if the current table is part of the permissions list, ($ .inArray (oSettings.nTable.getAttribute ('id'), allowFilter ) == -1) {// If the table should not be ignored, then return true;} checked = $ ('# incocon'). (': Check'); var qntStock = 1; var stock Col = 3; if (checked!) {Return true;} if (checked & amp; adata [stockcall]> qntStock) {return true;} return false;});
Comments
Post a Comment