1
votes

I'm implementing ag-grid enterprise for serverside grouping, sorting, loading etc.. I have problem to refresh the view, for eg. when I scroll to the bottom, and i click sort by certain column, scroll remains at the bottom, so first data gets loaded at the bottom of the table, and when I scroll back up i get inverted sort or whatever u could call it. What im expecting to happen when i click on sort, is to whole view of ag-grid to get to previous state, refresh/reinitialize with scroll on top.

Here is the official example, where u can see how ag-grid is getting reinitalized when rows get sorted. When i copy exact code from this plunkr into angular, it works as it should, until i change rowDataType to server side

rowDataType = 'serverSide';
params.api.setServerSideDatasource(dataSource);

As soon as I do that code in angular stops reinitiating on sorting as it should and as it previously did. Plunkr works just fine with or without 'serverSide'. So since code is exact same, I'm assuming im missing some import or smth??**

Another question so i dont spam around, in case anyone passing by knows. How to delete doubled columns after grouping. When i group by certain column, I get its duplicate as generated 'group' column, so i get same data in 2 columns, i wouldnt mind removing either of them. Eg:

enter image description here

1
Have you tried this.gridApi.setRowData(rowData);h_w
@hana_wujira I think its already added in html, but still i tried putting it like this prntscr.com/lflhxd and it didnt work.Kerim092
can you help me on this - stackoverflow.com/questions/56231178/…Olivia

1 Answers

0
votes

As I was guessing it was about imports. No clue which one of these fixed it, too short with the time to test, but one of them did. Imported these in agular-cli.json > scripts and it all started working as on plunkr:

"../node_modules/ag-grid/dist/ag-grid.min.js",
"../node_modules/ag-grid-enterprise/dist/ag-grid-enterprise.min.js",
"../node_modules/ag-grid-angular/updateGridAndColumnProperties.js",
"../node_modules/ag-grid-community/dist/ag-grid-community.min.js"

Still if anyone passing by knows second question in my post (about hiding one column thats grouped by) Id much appreciate it.