Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
150590 | Jan 13,2020 05:12 AM UTC | Jan 15,2020 10:55 AM UTC | Vue | 3 |
![]() |
Tags: Data Grid |
var pvt = {
key: true
}
export default {
data() {
return {
data: data,
grid: "",
toolbar: ["Add", "Delete", "Update", "Cancel"],
flag: true,
pageOption: {
pageSize: 12
},
editSettings: {
allowEditing: true,
allowAdding: true,
allowDeleting: true,
mode: "Batch"
}
};
},
methods: {
dataBound: function(args) {
var obj = {field: "ShipCountry", headerText: "Ship Country", width: "300"};
this.$refs.grid.ej2Instances.columns.push(obj);
if(pvt.key) { // you need to push this new column to the grid’s columns property and call the refreshColumns method to achieve your requirement
pvt.key = false; //It helps to prevent the recursive call
this.$refs.grid.ej2Instances.refreshColumns();
}
},
provide: {
grid: [Edit, Toolbar, Page]
}
};
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.