一开始打算用bootstrapble的,调通了。后来给了ued的图,bootstraptable实现不了那布局格式,需要自己根据数据动态画,就没用了这个了。
//按照这个顺序就行,否则会导致初始化访问两次,触发事件
$('#search').on('click',function(){
// $('#inventoryMainTable').bootstrapTable('refresh');
// inittable();
})
//表格数据查询
// function inittable(){
// $('#inventoryMainTable').bootstrapTable({
// url: url+'findYebInventory',
// pagination: true,
// sidePagination: "server",
// pageNumber: pageNumber,
// pageSize: pageSize,
// pageList: pageList,
// method: 'GET',
// contentType: "application/x-www-form-urlencoded",
// sortable: "true" ,
// locale: "zh-CN",
// uniqueId: "id",
// detailView: true,
// columns: [{
// field: 'userId',
// title: '用户 ID'
// }, {
// field: 'miniMainAccountNo',
// title: '主账号'
// }, {
// field: 'bizType',
// title: '业务类型'
// }, {
// field: 'instId',
// title: '代销机构'
// }, {
// field: 'balance.amount',
// title: '账户余额'
// }, {
// field: 'availableBalance.amount',
// title: '可用余额'
// }, {
// field: 'freezeAmount.amount',
// title: '冻结金额'
// }, {
// field: 'systemAmount.amount',
// title: '系统冻结金额'
// }],
// queryParams : function (params) {
// //这里的键的名字和控制器的变量名必须一致,这边改动,控制器也需要改成一样的
// var temp = $("#yebform").serializeJsonObject();
// temp["pageSize"] = params.limit; //页面大小
// temp["pageNumber"] = (params.offset / params.limit) + 1; //页码
// temp["sort"] = params.sort; //排序列名
// temp["sortOrder"] = params.order; //排位命令(desc,asc)
// return temp;
// },
// dataType: 'json',
// onLoadError: function(){ //加载失败时执行
// layer.msg("加载数据失败", {time : 1500, icon : 2});
// },
// onLoadSuccess: function(res){ //加载成功时执行
// initDistributintable(res.data.yebInventoryList.lsit[0].aftransResultist);//初始化后想执行的逻辑,一般不需要用到这个
// },
// //dataField: 'data', //server 后端 : json 对应的表格数据 key
// responseHandler: function (res) {//加载成功后对数据进行封装成bootstraptable支持的数据格式
// if(res.length==0||res.info.ok==undefined||!res.info.ok){
// layer.msg("加载数据失败:"+res.info.msg)
// return {
// "rows":[],
// "total":0
// }
// }
// layer.msg("加载成功");
// return {
// "rows":res.data.yebInventoryList.list[0].mftransResultist,
// "total":res.data.yebInventoryList.list[0].mftransResultist.count
// }
// },
// // onExpandRow: function (index, row, $detail) {
// // initSubTable(index, row, $detail);//内联子表
// // }
// })
// }
// initSubTable = function (index, row, $detail) {
// var fundArchiveVo = []
// if(row.fundArchiveVo!==null&&row.fundArchiveVo!==undefined){
// fundArchiveVo=[row.fundArchiveVo];
// }
// var cur_table = $detail.html('<table></table>').find('table');
// $(cur_table).bootstrapTable({
// // url: '/db/log/files.do',
// // method: 'get',
// // queryParams: { id: parentid },
// // ajaxOptions: { id: parentid },
// // uniqueId: "id",
// striped: true, //是否显示行间隔色
// pagination: false,//显示分页
// // sidePagination: "client",
// pageNumber:fundArchiveVo.length,
// pageSize: pageSize,
// pageList: pageList,
// columns: [{
// field: 'fundName',
// title: '基金名称'
// }, {
// field: 'fundNameAbbr',
// title: '基金简称'
// }, {
// field: 'trusteeName',
// title: '基金托管人'
// }, {
// field: 'fundType',
// title: '基金类型'
// }, {
// field: 'shareSize',
// title: '份额规模'
// },{
// field: 'assetSize',
// title: '资产规模'
// },],
// data:fundArchiveVo
// });
// }
// function initDistributintable(data) {
// var table=$('#inventoryDistributionTable').bootstrapTable({
// data: data[0].accountInfoList,
// columns: [{
// field: 'userId',
// title: '用户 ID'
// }, {
// field: 'miniMainAccountNo',
// title: '主账号'
// }, {
// field: 'bizType',
// title: '业务类型'
// }, {
// field: 'instId',
// title: '代销机构'
// }, {
// field: 'balance.amount',
// title: '账户余额'
// }],
// })
// }