Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
151047 | Jan 29,2020 05:34 AM UTC | Apr 8,2020 02:23 PM UTC | Angular - EJ 2 | 5 |
![]() |
Tags: Grid |
addButtonClick() {
// On button click dynamically generate ant set grid data
this.processListData(data.slice(0,10));
var grid = (document.getElementsByClassName('e-grid')[0]as any).ej2_instances[0];
grid.refreshColumns();
} |
...
addButtonClick() {
// On button click dynamically generate ant set grid data
this.processListData(data.slice(0,10));
var grid = (document.getElementsByClassName('e-grid')[0]as any);
this.refresh();
}
refresh(){
var grid = (document.getElementsByClassName('e-grid')[0]as any).ej2_instances[0];
grid.on('datasource-modified', (args) => {
setTimeout(this.refreshCol, 50);
}) //here, we have binded internal event and called refresh action. It will call the refresh column after dataSource modified
}
refreshCol() {
var grid = (document.getElementsByClassName('e-grid')[0]as any).ej2_instances[0];
grid.refreshColumns();
}
...
|
[app.component.ts]
addButtonClick(e) {
// On button click dynamically generate ant set grid data
this.isRefresh=true;
this.processListData(data.slice(0,10)); // bind the grid dataSource by programatically
}
beforeDataBound(args){
if(this.isRefresh){
this.isRefresh=false;
this.myGrid.refreshColumns();
}
}
|
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.