Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
147538 | Sep 15,2019 12:24 AM UTC | Oct 2,2019 06:25 AM UTC | Angular - EJ 2 | 9 |
![]() |
Tags: Grid |
Query: Adding a new row doesnt automatically close the dialog
We have already fixed “Edit dialog does not destroyed after performing add operation with custom binding” the issue. We suspect in your application, you are using old version. If so we suggest you to upgrade to the latest version to resolve the problem.
Query: Grouping creates another grouping after DataStateChangeEvent fetching new data.
By default, we have performed grouping in client side(source level) while using remote data based on the sorted data. Could you please share more information about your query and if possible share the sample or video to demonstrate the problem that will helpful for us to validate further at our end.
public dataSourceChanged(state: DataSourceChangedEventArgs): void {
if (state.action === 'add') {
this.crudService.addRecord(state).subscribe(() =>
{
this.grid.notify('recordAdded', state); // close the dialog
state.endEdit()});
}
. . . . . . .
}
}
|
return this.http
.get(`${this.BASE_URL}?${pageQuery}${sortQuery}${filterQuery}&$count=true`)
.pipe(map((response: any) => response.json()))
.pipe(map((response: any) => {
return state.dataSource === undefined ? (<DataResult>{
result: this.getResult(response),
count: parseInt(response['@odata.count'], 10),
}) : response['value'];
}))
.pipe(map((data: any) => data));
}
public getResult(response) {
// group the column based on the condition
if (this.gridState.group != undefined && (this.gridState.action == undefined || this.gridState.action.rows != undefined)) {
var json = response['value'];
this.gridState.group.forEach(element => {
// 'DataUtil.group' groups the input data based on the field name
json = DataUtil.group(json, element);
});
return json;
} else {
return response['value'];
}
}
|
public ngOnInit(): void {
this.pageOptions = { pageSize: 10, pageCount: 4 };
let state = { skip: 0, take: 10, sorted: [{ 'name': 'CustomerID', direction: 'Ascending' }], group:['CustomerID'] };
this.service.execute(state);
}
|
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.