AgGrid使用CellRendererFramework后,修改数据调用applyTransaction数据没刷新
ag-grid表格中使用了check显示,然后当修改数据后,调用applyTransaction方法,表格中没有刷新数据
经过排查问题,发现,再checkBoxYNCellRenderer
组件中使用的时 params.value
来获得值,改为 params.getValue()
就可以了
使用applyTransaction
更新数据源时,再cellRendererFramework组件中通过params.value
属性的到的值是旧值,用params.getValue()
方法获得的才是新值
JavaScript 全选
<template>
<div style="">
<el-checkbox v-model="value" disabled true-label="Y" false-label="N"></el-checkbox>
</div>
</template>
<script>
import Vue from 'vue';
export default Vue.extend({
name: 'checkboxYNCellRenderer',
mixins: [],
data () {
return {
value:''
};
},
computed:{
},
watch:{
},
created() {
this.setMood(this.params);
},
methods: {
refresh (params) {
this.setMood(params);
},
setMood (params) {
this.value = this.params.getValue();
},
},
});
</script>
版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
post 张国生