Filter Operations on Server
Filter Operations on Server
Najib Naji
Posts: 6Questions: 2Answers: 0
Hi dears I have a problems with filter it can't filter operation like
{
"mRender": function(data, type, row) {
return parseInt(row.salesprice / row.number - row.buyingprice / row.number);
}
and
{
"mRender": function(data, type, row) {
return parseInt(row.number - row.sum);
}
plss help me
**it is my filter code **
fixedHeader: true,
pageLength: -1,
initComplete: function () {
this.api().columns().every( function () {
var column = this;
var select = $('<select style="width:100%"><option value=""></option></select>')
.appendTo( $(column.header()))
.on( 'click', function (e) {
e.stopPropagation();
})
.on( 'change', function () {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
column
.search( val ? '^'+val+'$' : '', true, false )
.draw();
} );
column.data().unique().sort().each( function ( d, j ) {
select.append( '<option value="'+d+'">'+d+'</option>' )
} );
} );
},
it is the result

Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide
This discussion has been closed.
Answers
Kevin how to use that it is not clear ??
Hi dears there's no one Unable to answer this question

Please help me
When using
columns.renderyou need to usecells().render()to get the rendered data. Here is an example that sets a class for the rendered columns then in footCallback it checks for the class and usescells().render()instead ofcolumn().data()to build the select.http://live.datatables.net/naxenole/1/edit
Kevin