Hi , am referring below link to implement inline grid editing.
https://ko.infragistics.com/products/ignite-ui-angular/angular/components/grid/editing
i have 2 questions
1. how do i get data as json from grid on click of button. is there a way i can get delta records only like deleted data, modified data , added data etc
2. how does the above scenario handled in case we have server side pagination with multiple pages and grid has primary key defined. expectation is it should return all the pages data and not that particular page only
Thanks,
Peru
Hello Peru,
I have been looking into your question and determined that with the remote paging of the igx-grid, the data that can be accessed in the grid is the data that is contained only in the given page, precisely because remote paging is used and only a certain number of records are loaded.
What I could suggest as an approach is to implement a custom logic according to your application, with which, upon clicking a button, the entire data will be taken from the server, after which it will be converted into json format. This depends entirely on the services and how the date is retrieved from the server, however in the remote paging sample in our documentation we use the service's getData method and retrieve the totalCount records, i.e. the entire date. This date will then be passed to the JSON.stringify() method to convert it to json format. Finally, according to the custom logic of the sample in our documentation, which is to visualize a certain number of records per page, again with getData will load a certain number of records for the given page we are on.
Regarding the next question,there is a way to get only certain records like added, deleted or edited data. What I could suggest here is to handle the rowAdded event, which is executed when a row is added, the rowDeleted event, which is executed when a row is deleted, and the rowEditDone event, which is executed when a row is edited. By handling these events, when they fire we can take the date from the given event and add it to a different array depending on whether we have an add, delete or edit. Then there will be several arrays with the requested data, which again at the click of a button can be converted to json format with JSON.stringify().
The described scenarios can be observed here:
In addition, I have prepared small sample illustrating my suggestion which could be found here. Please test it on your side and let me know how it behaves.
If you require any further assistance on the matter, please let me know.
Regards,
Georgi Anastasov
Entry Level Software Developer
Infragistics
This is an initial update to let you know that we have received your support request and I am currently looking into this matter for you. I will keep you posted on my progress and I will get back to you soon with more information or questions for you.
Please feel free to continue sending updates to this case at any time.