When the button is clicked multi-column filtering on the server side
When the button is clicked multi-column filtering on the server side
v10258
Posts: 8Questions: 0Answers: 0
[code]
$.fn.dataTableExt.afnFiltering.push(
function (oSettings, aData, iDataIndex) {
var txtName = document.getElementById('txtName').value;
txtName = $.trim(txtName);
var colunm1 = $.trim(aData[0]);
if (txtName == "") {
return true;
} else if (colunm1 == txtName) {
return true;
}
return false;
}
);
$(function () {
var oTable = $('#example').dataTable({
"bFilter": true,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/dataTable.php"
});
$('#send').click(function(){
oTable.fnDraw();
});
})
[/code]
I found that it can not filter data "txtName = document.getElementById('txtName').value;" passed to the server
what can i do ? please help me...
Is that so?
[code]
"fnServerParams": function ( aoData ) {
var txtName = document.getElementById('txtName').value;
aoData.push( { "name": "more_data", "value": "txtName " } );
}
[/code]
But I do not know how to call “fnServerParams” to server.
Like this?
[code]
$(function () {
var oTable = $('#example').dataTable({
"bFilter": true,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/dataTable.php"
});
$('#send').click(function(){
oTable.fnServerParams(aoData ){
var txtName = document.getElementById('txtName').value;
aoData.push( { "name": "more_data", "value": "txtName " } );
}
});
}
[/code]
$.fn.dataTableExt.afnFiltering.push(
function (oSettings, aData, iDataIndex) {
var txtName = document.getElementById('txtName').value;
txtName = $.trim(txtName);
var colunm1 = $.trim(aData[0]);
if (txtName == "") {
return true;
} else if (colunm1 == txtName) {
return true;
}
return false;
}
);
$(function () {
var oTable = $('#example').dataTable({
"bFilter": true,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/dataTable.php"
});
$('#send').click(function(){
oTable.fnDraw();
});
})
[/code]
I found that it can not filter data "txtName = document.getElementById('txtName').value;" passed to the server
what can i do ? please help me...
Is that so?
[code]
"fnServerParams": function ( aoData ) {
var txtName = document.getElementById('txtName').value;
aoData.push( { "name": "more_data", "value": "txtName " } );
}
[/code]
But I do not know how to call “fnServerParams” to server.
Like this?
[code]
$(function () {
var oTable = $('#example').dataTable({
"bFilter": true,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/dataTable.php"
});
$('#send').click(function(){
oTable.fnServerParams(aoData ){
var txtName = document.getElementById('txtName').value;
aoData.push( { "name": "more_data", "value": "txtName " } );
}
});
}
[/code]
This discussion has been closed.