layui弹出响应式table
$.post("数据请求路径", data, function (data) {
var obj = eval('(' + data + ')');
if (obj.code == 0) {
table.render({
elem: '#openProductTable'
, data: obj.data
, page: true
, limit: 30
, cellMinWidth: 100
, cols: [[
{ field: 'ItemId', title: '商品编号', width: 100 }
, { field: 'ItemName', title: '商品名称' }
, { field: 'ItemType', title: '商品规格' }
, { field: 'ItemCount', title: '商品数量', width: 100 }
, { field: 'ItemPrice', title: '商品单价', width: 100 }
, { field: 'ItemMoney', title: '订单金额', width: 100 }
]]
});
var detail = layer.open({
type: 1,
maxmin: true,
content: $('#openProductBox'),
area: ['100%', '100%'],
shade: 0.5,
success: function (layero, index) {
}
});
layer.full(detail);
table.resize('openProductTable');
} else {
layer.msg('查询数据失败:' + obj.msg, { icon: 5 })
};
}).error(function () {
layer.msg('查询失败', { icon: 5 })
});