当前位置:网站首页>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监听。
边栏推荐
- Using helm to install rainbow in various kubernetes
- Opencv learning note 5 - gradient calculation / edge detection
- MES系統,是企業生產的必要選擇
- [quick start of Digital IC Verification] 12. Introduction to SystemVerilog testbench (svtb)
- 发挥创客教育空间的广泛实用性
- Don't stop chasing the wind and the moon. Spring mountain is at the end of Pingwu
- Go语言中,函数是一种类型
- Pytoch (VI) -- model tuning tricks
- 单场带货涨粉10万,农村主播竟将男装卖爆单?
- Ebpf cilium practice (2) - underlying network observability
猜你喜欢
The truth of robot education in hands-on practice
【雅思口语】安娜口语学习记录 Part2
Coquette data completes the cloud native transformation through rainbow to realize offline continuous delivery to customers
National standard gb28181 protocol video platform easygbs adds streaming timeout configuration
Automatic upgrading of database structure in rainbow
Vulnerability recurrence easy_ tornado
Rainbond 5.6 版本发布,增加多种安装方式,优化拓扑图操作体验
Open3D ISS关键点
In go language, function is a type
Openvscode cloud ide joins rainbow integrated development system
随机推荐
In go language, function is a type
解析创新教育体系中的创客教育
Splunk查询csv lookup table数据动态查询
SSM 整合
IP guard helps energy enterprises improve terminal anti disclosure measures to protect the security of confidential information
使用BiSeNet实现自己的数据集
Xcit learning notes
Tuowei information uses the cloud native landing practice of rainbow
藏书馆App基于Rainbond实现云原生DevOps的实践
机器人教育在动手实践中的真理
Full text query classification
A method for quickly viewing pod logs under frequent tests (grep awk xargs kuberctl)
IP-guard助力能源企业完善终端防泄密措施,保护机密资料安全
Understanding of out covariance, in inversion and invariance in kotlin
CCTV is so warm-hearted that it teaches you to write HR's favorite resume hand in hand
One click installation of highly available Nacos clusters in rainbow
Fluentd is easy to use. Combined with the rainbow plug-in market, log collection is faster
opencv学习笔记二——图像基本操作
BiSeNet的特點
Rainbond 5.6 版本发布,增加多种安装方式,优化拓扑图操作体验