[英]Ag-grid - Events and Methods (Vuejs)
我无法使用“保存”方法保存对表数据的更改
我正在使用“cellValueChanged”方法来编辑和保存表格单元格。
<ag-grid-vue :cellValueChanged="save"></ag-grid-vue>
methods: {
save() {
const method = this.instituicao.id ? 'put' : 'post'
const id = this.instituicao.id ? `/${this.instituicao.id}` : ''
axios[method](`${baseApiUrl}/instituicao${id}`, this.instituicao)
.then(() => {
this.$toasted.global.defaultSuccess()
this.reset()
})
.catch(showError)
},
错误信息:在此处输入图像描述
要达到预期的结果,请使用@cell-value-changed 的事件回调
save(event) { console.log('onCellValueChanged: ' + event.oldValue + ' to ' + event.newValue); }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.