layui table 清楚缓存_layui的table参数条件缓存问题

layui的table组件在渲染时会缓存部分配置,导致reload时存在缓存问题。解决方法是在reload时明确指定url和where参数,或者在done回调中删除where属性来避免缓存。此外,取消分页不仅需设置page: false,还可能需设置limit: 999。
摘要由CSDN通过智能技术生成

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值