版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_34169802/article/details/79065553
public void page() {
Map<String, Object> result = new HashMap<String, Object>();
try {
int limit = getParaToInt("limit");
int offset = getParaToInt("offset");
Page<Record> page = service.page(limit, offset);
result.put("rows", page.getList());
result.put("total", page.getTotalRow());
} catch (Exception e) {
e.printStackTrace();
result.put("rows", 0);
result.put("total", new ArrayList<>());
}
renderJson(result);
}
Javascript: parent.window.scrollTo(0, 0);
var businessFormatTable = $('#businessFormatTable').bootstrapTable({
url : '$!contextPath/businessFormat/businessFormatPage?isOpenWanKeAutoSync=$!isOpenWanKeAutoSync',
columns : [ {
field : 'hotel_group_code',
title : '集团代码',
align : 'center',
halign : 'center',
valign : 'middle',
}, {
field : 'hotel_code',
title : '酒店代码',
align : 'center',
halign : 'center',
valign : 'middle',
}, {
field : 'type',
title : '滑雪场类型',
align : 'center',
halign : 'center',
valign : 'middle',
formatter : function(value, row, index) {
if (value == "SKI") {
return "滑雪场";
} else {
return value;
}
}
}, {
title : '操作',
align : 'left',
halign : 'center',
valign : 'middle',
formatter : function(value, row, index) {
var fnc = '';
fnc += '<a href="javascript:;" onClick="viewbusinessFormatForm(\'' + row.uuid + '\')" class="btn btn-warning btn-xs"><i class="fa fa-pencil"></i> 编辑</a>';
fnc += '<a href="javascript:;" onClick="delbusinessFormat(\'' + row.uuid + '\')" class="btn btn-danger btn-xs"><i class="fa fa-remove"></i> 删除</a>';
return fnc;
}
} ],
idField : 'uuid',
pagination : true,
paginationPreText : '上一页',
paginationNextText : '下一页',
sidePagination : 'server',
cache : false,
});