mRender is not working
mRender is not working
pankajshr
Posts: 3Questions: 0Answers: 0
I have jquery datatable (http://datatables.net) and want to create custom filter which excludes content inside any html select element. Following is the code I have written but its not working:-
[code]
$('.dataTable_exportable').dataTable( {
"sDom": 'Tlfrtip',
"bAutoWidth": true,
"aoColumnDefs": [ { "aTargets": [12], "mRender": function(data, type, full) { return data.replace(/)<[^<]*)*<\/select>/gi, ""); }, "sType": "comments" } ]
});
[/code]
where 12 is the number of column which contains that select boxes starting from 0.
But it still taking the complete content of cell include select html field into search. Can anyone suggest why this code is not working ?
Proof that regex I used in replace is working correctly- jsfiddle.net/QubMc
[code]
$('.dataTable_exportable').dataTable( {
"sDom": 'Tlfrtip',
"bAutoWidth": true,
"aoColumnDefs": [ { "aTargets": [12], "mRender": function(data, type, full) { return data.replace(/)<[^<]*)*<\/select>/gi, ""); }, "sType": "comments" } ]
});
[/code]
where 12 is the number of column which contains that select boxes starting from 0.
But it still taking the complete content of cell include select html field into search. Can anyone suggest why this code is not working ?
Proof that regex I used in replace is working correctly- jsfiddle.net/QubMc
This discussion has been closed.
Replies
Allan