Hi,
I m using a dynnamic ejGrid, which i add its columns at ngAfterViewInit(), and sets it datasource after pressing Search button.
"
ngAfterViewInit(){
var obj = $("#webReportGrid").ejGrid("instance");
this.myService.getWebReportInfo(this.reportId).subscribe(
data => {
var columns = data.userViewColumns;
var gridColumns;
for (var i = 0; i < columns.length; i++) {
var newColumn = { field: columns[i].field, headerText: columns[i].name, width: 100, textAlign: "center" }
gridColumns = obj.model.columns.push(newColumn);
}
},
err => console.error(err),
() => console.log('done getting report info')
);
this.gridData=[];
}
search()
{
this.gridData=[];//here the columns is appeared at UI
}
The issue is that after adding the columns to grid, it does not appear, it appears only after pressing the button and set the datasource, if i set it after adding the columns at ngAfterViewInit() it does not appear,
kindly let me know what to do to make the grid appears with its columns to the user, before search button is pressed.
Regards