javascript
getData(id, dom, num, limit, function (d) {
laypage.render({
elem: (dom.parents('.order-list')).get(0).querySelector('#page'),//dom元素
count: d.total,
limit: limit,
first: '首页',
last: '尾页',
prev: '<em><</em>',
next: '<em>></em>',
jump: function(obj, first){
getData(id, dom, obj.curr, obj.limit );
}
});
})
function getData(id, dom, num, limit, cb) {
$.ajax({
url: 'index/layorder?agentid='+ id +'&pagenum=' + num + '&limit=' + limit,
type: 'get',
data: '',
dataType: 'json',
success: function (d) {
var data = d.row;
var total = d.total;
// 渲染方法
cb && cb(d);
dom.html( laytpl(elemOrder).render(data) );
},
error: function (err) {
}
})
}
123456789101112131415161718192021222324252627282930313233
评论 (0)