要包含排序列和方向,只需包含服务器端变量col
在 url 模板内的示例中:
ajaxUrl : "http:/mydatabase.com?page={page}&size={size}&{sortList:col}&{filterList:fcol}",
The {page}
是用户正在查看的当前页面,并且{size}
是在浏览器中显示的行数。
Include &{sortList:col}
(with col
匹配排序列和方向的服务器端变量)以包括排序。并包括&{filterLost:fcol}
(with fcol
匹配用于过滤列的服务器端变量)以包括过滤。寻呼机插件将字符串格式化为&col[2]=0&col[3]=0
(或其他)为你。
如果你看一下ajaxProcessing
函数,它所做的只是重新格式化来自服务器的ajax数据当前行集显示(不是所有行)以匹配此所需格式:
// process ajax so that the following information is returned:
// [ total_rows (number), rows (array of arrays), headers (array; optional) ]
// example:
[
100, // total rows
[
[ "row1cell1", "row1cell2", ... "row1cellN" ],
[ "row2cell1", "row2cell2", ... "row2cellN" ],
...
[ "rowNcell1", "rowNcell2", ... "rowNcellN" ]
],
[ "header1", "header2", ... "headerN" ] // optional
]
如果数据库中的行数不确定,只需返回0
... it should仍然有效,但随后totalPages
and totalRows
变量将不准确。