I have a grid where I assign url
I change the url when the accountid changes.
but the data is not loaded to the grid and still shows old data.
I have also used onBindingComplete which keep loading the grid.
Example
projectSource: any =
{
datatype: ‘json’,
cache: false,
pagesize: 10,
totalrecords: 0,
pagenum: 0,
datafields: [
{ name: ‘id’, type: ‘string’ },
{ name: ‘projectName’, type: ‘string’ },
{ name: ‘projectURLPath’, type: ‘string’ },
{ name: ‘createdDateTime’, type: ‘date’ },
{ name: ‘status’, type: ‘string’ },
{ name: ‘projectSize’, type: ‘number’}
],
url: ‘/api/v1/account/’ + this.accountId + ‘/project/’,
root: “data>projects”,
pager: (pagenum: any, pagesize: any, oldpagenum: any): void => {
this.currentPage = pagenum;
this.pageSize = pagesize;
},
filter: () => {
if(this.projectGrid){
this.projectGrid.updatebounddata(‘filter’);
}
},
sort: () => {
if(this.projectGrid){
this.projectGrid.updatebounddata(‘sort’);
}
},
beforeprocessing: (data) => {
if (data != null) {
if(this.projectSource){
this.projectSource.totalrecords = data[“data”].totalRows;
this.totalItems = data[“data”].totalRows;
}
}
},
formatdata: (data) => {
return data;
}
};