当前位置:网站首页>JEditableTable的使用技巧
JEditableTable的使用技巧
2022-07-07 05:27:00 【OK_boom】
JEditableTable使用默认的条件进行查询
JEditableTable靠织入JeecgListMixin来实现查询,created的时候会优先执行JVxeTableModelMixin的created,所以会优先load一次data。
好在它有个开关可以关闭它自动加载数据。
在我们自己的查询vue处理上,在data里加入disableMixinCreated:true并且在created里面自己手动加载数据即可。
created() {
this.getSuperFieldList()
this.$nextTick(()=>{
if (this.type=='purchase'){
this.$set(this.queryParam,'approved',"1")
}
this.loadData();
//初始化字典配置 在自己页面定义
this.initDictConfig();
})
}
JEditableTable修改记录的默认值
尝试了很多种方案,最后确定要修改JEditableTable的dataSource并需要触发它的监听功能才能将新的数据加载到界面,但JEditableTable的dataSource 监听没有deep,要加上才能监听到dataSource内容的变化。
dataSource: {
immediate: true,
deep: true,
handler: function (newValue) {
// 兼容IE
this.getElementPromise('tbody').then(() => {
this.initialize()
this._pushByDataSource(newValue)
})
}
},
下面要实现的是,当数据联动让JEditableTable里面的select类型的字段的options重新刷新并将JEditableTable所有记录这个字段的值清空
async prodCatChange(value){
//tbVendor 是JEditableTable实例
let tbVendor = await getRefPromise(this, 'smpProductVendor')
let column=tbVendor.columns.filter(m=>m.key=='vendorId')[0]
column.options=[]//必须清空,不然会记录叠加
tbVendor._loadDictConcatToOptions(column)
let dataSource=this.smpProductVendorTable.dataSource
dataSource.forEach(item=>{
item.vendorId='.'
})
dataSource.forEach(item=>{
item.vendorId=''
})
},
代码里为什么要将vendorId设置两次? 因为设置一次的话,重复执行这个方法它就无法再次触发tbVendor的dataSource监听。
边栏推荐
- Detailed explanation of apply, also, let, run functions and principle analysis of internal source code in kotlin
- The use of generics and vararg variable parameters in kotlin
- MES系统,是企业生产的必要选择
- 打通法律服务群众“最后一公里”,方正璞华劳动人事法律自助咨询服务平台频获“点赞”
- [quick start of Digital IC Verification] 12. Introduction to SystemVerilog testbench (svtb)
- MES system is a necessary choice for enterprise production
- 柯基数据通过Rainbond完成云原生改造,实现离线持续交付客户
- Zcmu--1492: problem d (C language)
- One click installation of highly available Nacos clusters in rainbow
- Iptables' state module (FTP service exercise)
猜你喜欢
探索STEAM艺术设计中的创造力
Battery and motor technology have received great attention, but electric control technology is rarely mentioned?
在 Rainbond 中一键安装高可用 Nacos 集群
PLSQL的安装和配置
Fluentd is easy to use. Combined with the rainbow plug-in market, log collection is faster
归并排序和非比较排序
在Rainbond中实现数据库结构自动化升级
Application of slip ring of shipborne radar antenna
opencv学习笔记四——膨胀/腐蚀/开运算/闭运算
Rainbond 5.6 版本发布,增加多种安装方式,优化拓扑图操作体验
随机推荐
接口作为参数(接口回调)
Coquette data completes the cloud native transformation through rainbow to realize offline continuous delivery to customers
Deit learning notes
Opencv learning notes II - basic image operations
如何理解分布式架构和微服务架构呢
Snyk 依赖性安全漏洞扫描工具
Installation and configuration of PLSQL
[go ~ 0 to 1] obtain timestamp, time comparison, time format conversion, sleep and timer on the seventh day
国标GB28181协议视频平台EasyGBS新增拉流超时配置
单元测试报告成功率低
MES系统,是企业生产的必要选择
Application of slip ring of shipborne radar antenna
OpenVSCode云端IDE加入Rainbond一体化开发体系
Infix keyword infix expression and the use of generic extension function in kotlin
opencv学习笔记一——读取图像的几种方法
Ebpf cilium practice (1) - team based network isolation
One click installation of highly available Nacos clusters in rainbow
JS copy picture to clipboard read clipboard
IELTS review progress and method use [daily revision]
探索STEAM艺术设计中的创造力