problem with serverside
problem with serverside
i got a problem,i wrote the code like the under,but if i reload the page,i found the number of the table is less than the data in database,i guess,the js didnt get data from serverside ,maybe data in cache or what wrong i had.
i am not good at english,i hope someone can understand and helpme.thank you
var oTable;
oTable =$('#example').dataTable({
"bProcessing": true,
"bServerSide": true,
"sPaginationType": "full_numbers",
"aaSorting": [[ 5, "desc" ]],
"aoColumns": [
{ "bSortable": false },
{ "bSortable": false },
{"fnRender": function ( oObj ) {
var imgpath;
if(oObj.aData[2]=="1")
{
imgpath="/images/zhu_index_qian_gongying_but.gif";
}
if(oObj.aData[2]=="2")
{
imgpath="/images/zhu_index_qian_qiugou_butto.gif";
}
if(oObj.aData[2]=="3")
{
imgpath="/images/zhu_index_qian_hezuo_button.gif";
}
var temp="";
return temp;
}},
null,
null,
null,
{ "fnRender": function ( oObj ) {
var tmp="";
return tmp;
},"bSortable": false},
{ "fnRender": function ( oObj ) {
var tmp="";
return tmp;
} ,"bSortable": false }
],
"sAjaxSource": "/ajax/ajaxget.aspx?action=getbizlist&state=0"
} );
i am not good at english,i hope someone can understand and helpme.thank you
var oTable;
oTable =$('#example').dataTable({
"bProcessing": true,
"bServerSide": true,
"sPaginationType": "full_numbers",
"aaSorting": [[ 5, "desc" ]],
"aoColumns": [
{ "bSortable": false },
{ "bSortable": false },
{"fnRender": function ( oObj ) {
var imgpath;
if(oObj.aData[2]=="1")
{
imgpath="/images/zhu_index_qian_gongying_but.gif";
}
if(oObj.aData[2]=="2")
{
imgpath="/images/zhu_index_qian_qiugou_butto.gif";
}
if(oObj.aData[2]=="3")
{
imgpath="/images/zhu_index_qian_hezuo_button.gif";
}
var temp="";
return temp;
}},
null,
null,
null,
{ "fnRender": function ( oObj ) {
var tmp="";
return tmp;
},"bSortable": false},
{ "fnRender": function ( oObj ) {
var tmp="";
return tmp;
} ,"bSortable": false }
],
"sAjaxSource": "/ajax/ajaxget.aspx?action=getbizlist&state=0"
} );
This discussion has been closed.
Replies
I think the problem can be solved by using POST to obtain your data rather than GET. Have a look at this example: http://datatables.net/examples/server_side/post.html
Regards,
Allan