天天看点

耻辱记录!!耻辱记录!!

耻辱记录!!

因为自己不细心,给自己造成了巨大麻烦!!

后台数据获取正常,layUI页面表单数据渲染不出来。

我来说说我的耻辱经历!

在网上找了半天,查不到原因,直到看见了,一个博主的layUI页面,才发现自己愚蠢至极的操作!!!

这是正确的表单页面:

var tableIns = table.render({
   elem: '#userList',//数据表格
   url: ctx +'/user/list',
   cellMinWidth:95,
   page :true,
   height:"full-125",
   limits: [10,15,20,25],
   limit:10,
   toolbar:"#toolbarDemo",
   id: "userListTable",
   cols : [[
       {type: "checkbox",fixed: "left",width:50},
       {field: 'id',title:"编号",fixed: "true",width:80},
       {field: 'userName',title:'用户名',minWidth: 50,align:'center'},
       {field: 'email',title:'邮箱',minWidth: 100,align:'center'},
       {field: 'phone',title:'电话',minWidth: 100,align:'center'},
       {field: 'trueName',title:'真实姓名',align:'center'},
       {field: 'createDate',title:'创建时间',minWidth: 150,align:'center'},
       {field: 'updateDate',title:'更新时间',minWidth: 150,align:'center'},
       {title:'操作',minWidth: 150,templet:'#userListBar',fixed: "right",align: 'center'}
   ]]
});
           

而我当时的页面是这样写的:

var tableIns = table.render({
   elem: '#userList',//数据表格
   url: ctx +'/user/list',
   cellMinWidth:95,
   page :true,
   height:"full-125",
   limits: [10,15,20,25],
   limit:10,
   toolbar:"#toolbarDemo",
   id: "userListTable",
   cols : [[
       {type: "checkbox",fixed: "left",width:50},
       {type: 'id',title:"编号",fixed: "true",width:80},
       {type: 'userName',title:'用户名',minWidth: 50,align:'center'},
       {type: 'email',title:'邮箱',minWidth: 100,align:'center'},
       {type: 'phone',title:'电话',minWidth: 100,align:'center'},
       {type: 'trueName',title:'真实姓名',align:'center'},
       {type: 'createDate',title:'创建时间',minWidth: 150,align:'center'},
       {type: 'updateDate',title:'更新时间',minWidth: 150,align:'center'},
       {title:'操作',minWidth: 150,templet:'#userListBar',fixed: "right",align: 'center'}
   ]]
});
           

哈哈哈。太他吗愚蠢了!!!

由于自己懒,在写了第一个

接下来就直接Ctrl +C+V,就没注意其他的就不是type了,真真的太他妈蠢了!!!

遇到 **后台数据获取正常,layUI页面表单数据渲染不出来。**的情况大多都是后台数据与表单里面设置的名称不一致造成的,希望这样的错误以后不要在出现了。

继续阅读