Filter records based on column data
Filter records based on column data
prathap
Posts: 11Questions: 1Answers: 0
My data array contains boolean (yes/no), tinyint (0/1/2) values. In fnCreatedRow function, i change it to respective text to display like below:
[code]
"fnCreatedRow": function (nRow, aData, iDataIndex) {
(aData[3] == 'Yes') ? $(nRow.cells[2]).html("Scheduled") : $(nRow.cells[2]).html("Manual");
}
[/code]
Now when i do search with [quote] Schedule [/quote], i am not getting any data. But if i search with [quote] Yes [/quote], i will get the respective row.
Can someone please give me a solution to search on the column data rather than on data array?
Regards,
Prathap.
[code]
"fnCreatedRow": function (nRow, aData, iDataIndex) {
(aData[3] == 'Yes') ? $(nRow.cells[2]).html("Scheduled") : $(nRow.cells[2]).html("Manual");
}
[/code]
Now when i do search with [quote] Schedule [/quote], i am not getting any data. But if i search with [quote] Yes [/quote], i will get the respective row.
Can someone please give me a solution to search on the column data rather than on data array?
Regards,
Prathap.
This discussion has been closed.
Replies
The 1.10 documentation discusses this: http://next.datatables.net/manual/orthogonal-data
Allan
Regards,
Prathap.
[code]
{ "sTitle": "Bill Type",
"mRender": function (data, type, row) {
if(type == 'display' || type == 'filter'){
if (data == 'Yes'){ return "Scheduled";} else {return "Manual";}
}
else{ return data;}
}
},
[/code]
Please confirm, if this is best method for displaying / filtering data irrespective of acutal data returned by JSON array.
Regards,
Prathap.
Allan
Regards,
Prathap.