Hello,
I have put custom code below in grid loadData() but now I click on columns to change sort order and I see the query always sort using second column.
Can you help me?
This is the code:
grid0LoadData(event: any) {
if ((this.recenti.value==false || this.recenti.value==null) && ("am" !== this.security.user.roles[0])) {
this.ricocoDb.getRicocoConRuolos(${event.filter} and (Ruolo eq '${this.security.user.roles[0]}')
, event.top, event.skip,${event.orderby}
, event.top != null && event.skip != null, null, null, null)
.subscribe((result: any) => {
this.getRicocosResult = result.value;
this.getRicocosCount = event.top != null && event.skip != null ? result['@odata.count'] : result.value.length;
}, (result: any) => {
});
}
if ((this.recenti.value==false || this.recenti.value==null) && ("am" === this.security.user.roles[0])) {
this.ricocoDb.getRicocoConRuolos(`${event.filter}`, event.top, event.skip, ``, event.top != null && event.skip != null, null, null, null)
.subscribe((result: any) => {
this.getRicocosResult = result.value;
this.getRicocosCount = event.top != null && event.skip != null ? result['@odata.count'] : result.value.length;
}, (result: any) => {
});
}
if (this.recenti.value==true && ("am" !== this.security.user.roles[0])) {
this.ricocoDb.getRecentiConRuolos(`${event.filter} and (Ruolo eq '${this.security.user.roles[0]}')`, event.top, event.skip, `${event.orderby}`, event.top != null && event.skip != null, null, null, null)
.subscribe((result: any) => {
this.getRicocosResult = result.value;
this.getRicocosCount = event.top != null && event.skip != null ? result['@odata.count'] : result.value.length;
}, (result: any) => {
});
}
if (this.recenti.value==true && ("am" === this.security.user.roles[0])) {
this.ricocoDb.getRecentiConRuolos(`${event.filter}`, event.top, event.skip, ``, event.top != null && event.skip != null, null, null, null)
.subscribe((result: any) => {
this.getRicocosResult = result.value;
this.getRicocosCount = event.top != null && event.skip != null ? result['@odata.count'] : result.value.length;
}, (result: any) => {
});
}
}