日期:2014-05-16 浏览次数:20481 次
var queryResults = query.select(),//此时获取到的就是所有记录
recordsperpage = parseInt(ts.p.rowNum,10),
total = queryResults.length,
page = parseInt(ts.p.page,10),
totalpages = Math.ceil(total / recordsperpage),
retresult = {};
queryResults = queryResults.slice( (page-1)*recordsperpage , page*recordsperpage );//这里对记录进行了裁剪,获取当前页数据