//展示已知数据
table.render({
elem: '#grid'
,cols: [[ //标题栏
{field: 'id', title: 'ID', width: 80, sort: true}
,{field: 'username', title: '用户名', width: 120}
,{field: 'email', title: '邮箱', minWidth: 150}
,{field: 'city', title: '城市', width: 100}
,{field: 'selectName', title: '下拉框', templet: '#selectGxmc'}
,{field: 'layuiData', title: '日期框', templet: '#layuiDataGxmc'}
,{field: 'editText', title: '编辑框', edit:'text'}
]]
,data: [{
"id": "10001"
,"username": "杜甫"
,"email": "xianxin@layui.com"
,"city": "浙江杭州"
,"layuiData":''
,'editText':'1'
},{"id": "10002"
,"username": "杜甫2"
,"email": "xianxin@layui.com"
,"city": "浙江杭州"
}, {
"id": "10003"
,"username": "杜甫3"
,"email": "xianxin@layui.com"
,"city": "浙江杭州"
}]
,skin: 'line' //表格风格
,even: true
//,page: true //是否显示分页
//,limits: [5, 7, 10]
//,limit: 5 //每页默认显示的数量
,done: function (res, curr, count) {
count || this.elem.next('.layui-table-view').find('.layui-table-header').css('overflow', 'auto');
layui.each($('select'), function (index, item) {
var elem = $(item);
elem.val(elem.data('value')).parents('div.layui-table-cell').css('overflow', 'visible');
});
// form.render();
}
});