layui的table在render的时候,会将部分参数缓存下来,以至于在开发过程中发现,layui的reload方法似乎有“缓存”的功能.
原因:在某博客发现,table内部是采用的继承的方法.
var tableObj = table.render({
elem: ‘#LAY-WASTE-CONTRACT‘
,page: false
,url: baseurl4 + "/" + contractId
,even: true
,headers: {
access_token: layui.data(setter.tableName).access_token,
}
,cols: [[
{type: ‘numbers‘, title: ‘序号‘, unresize: true},
{field: ‘wasteCategory‘, title: ‘废物类别‘, key: true},
{field: ‘wasteName‘, title: ‘废物名称‘, key: true},
{field: ‘unitPrice‘, title: ‘单价‘, event: "unitPrice", key: true},
{field: ‘wasteWeight‘, title: ‘重量‘, key: true, templet: ‘#test‘},
{field: ‘wasteMoney‘, title: ‘危废金额‘, key: true}
]]
,skin: ‘line‘
,height: ‘160‘
,done:function () {
console.info(this);
delete this