problem of Initial table with query terms

problem of Initial table with query terms

ougoug Posts: 1Questions: 1Answers: 0

1> I create query-entry text box in tfoot on interface A, shown below
$('#example tfoot th').each( function () {
var title = $(this).text();
$(this).html( '<input type="text" placeholder="'+title+'" />' );
}
} );
var table = $('#example').DataTable({
"order": [[ 0, "desc" ]],
"scrollX": true, "processing": true,"bLengthChange":false,
"paging": true,"serverSide": true,
"ajax":{
url:"j_getdata"
},
"columns" : [{"data" : "id",}},
{"data" : "pic","name":"pic"}]
});
2> datatables runs well on interface A, and I need jump to interface B with the query parameters, when I return to interface A from interface B, I need put the query parameters into the query-entry text box ,and query data from database with ajax.I tried many ways, but I can't finished this work well.
I use the code below, it can realize the function. But it obviously is bad, because datatables will load data three times, Then I use callback function,but I failed.
$("tfoot input").each( function (i) {
switch(i)
{
case 0:
this.value='${q_id!}';
break;
case 1:
this.value='${q_pic!}';
break;
}
table.columns(i).search(this.value);
table.draw();
} );

could you help me ,any suggest would be appreciate.
I think the better way is set the query parameters into datatables before it load data from server. I don't know how can I do that,
BTW, I get the query parameters with java code --- request.getParameter("columns[0][search][value]");

help~~~~~~~~~

This discussion has been closed.