individual column filtering: suggested enhancement
individual column filtering: suggested enhancement
I'm not 100% sure if this is correct, but by adding after this section of code:[code]aoData.push( { "name": "sSearch_"+i, "value": oSettings.aoPreSearchCols[i].sSearch } );
aoData.push( { "name": "bEscapeRegex_"+i, "value": oSettings.aoPreSearchCols[i].bEscapeRegex } );
aoData.push( { "name": "bSearchable_"+i, "value": oSettings.aoColumns[i].bSearchable } );[/code]add this:[code]tmpsName = oSettings.aoColumns[i].sName;
if (typeof(tmpsName)!='undefined') {
aoData.push( { "name": "sSearch_"+tmpsName, "value": oSettings.aoPreSearchCols[i].sSearch } );
aoData.push( { "name": "bEscapeRegex_"+tmpsName, "value": oSettings.aoPreSearchCols[i].bEscapeRegex } );
aoData.push( { "name": "bSearchable_"+tmpsName, "value": oSettings.aoColumns[i].bSearchable } );
}[/code]
It makes field referencing a LOT easier (at least how I do things). Mostly, I got REAL tired trying to debug my code, as somehow the indexes aren't meshing with what I expect.
aoData.push( { "name": "bEscapeRegex_"+i, "value": oSettings.aoPreSearchCols[i].bEscapeRegex } );
aoData.push( { "name": "bSearchable_"+i, "value": oSettings.aoColumns[i].bSearchable } );[/code]add this:[code]tmpsName = oSettings.aoColumns[i].sName;
if (typeof(tmpsName)!='undefined') {
aoData.push( { "name": "sSearch_"+tmpsName, "value": oSettings.aoPreSearchCols[i].sSearch } );
aoData.push( { "name": "bEscapeRegex_"+tmpsName, "value": oSettings.aoPreSearchCols[i].bEscapeRegex } );
aoData.push( { "name": "bSearchable_"+tmpsName, "value": oSettings.aoColumns[i].bSearchable } );
}[/code]
It makes field referencing a LOT easier (at least how I do things). Mostly, I got REAL tired trying to debug my code, as somehow the indexes aren't meshing with what I expect.
This discussion has been closed.
Replies
That's a nice little enhancement. It does simply shift the burden of mapping the indexes from the client-side to the server-side, but I quite like that. I've been thinking about making use of sName a little bit more - I might come back to this, and I'm sure others will find it useful! Thanks.
Regards,
Allan