Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1415
Get the old / initial grid data
posted

Hello Team,

I am using igx data grid. Is there any property or method to get initial grid data which i can store in a variable and use it during the cancel operation to restore the grid data.

Please provide a stackbliz sample, if possible ASAP as it is an ongoing project.

Thanks.

Parents
No Data
Reply
  • 960
    Suggested Answer
    Offline posted

    Hello Shobhana Suara,

     

    There are two ways. One is to store the initial data in some other variable by yourself in the ordinary way and the other is to use the transaction feature in batch updating of the IgxGrid.

     

    The first one is just to copy the initial data source object in the typescript and Angular way by yourself and to compare the values in the bound datasource to the copied initial data source. Since this is outside of our product, please find a way by Internet search by yourself if you want to know it more concretely.

     

    The second one is explained here: https://ko.infragistics.com/products/ignite-ui-angular/angular/components/grid/batch_editing.html .You can also find a sample there.

    If you need a simpler sample, I put one here for your reference: https://stackblitz.com/edit/github-cmykmw?devtoolsheight=33&file=src/app/app.component.ts

    When IgxGrid's batch updating and transaction are used, new values are suspended without being committed to the local bound datasource until the change is explicitly committed. New values are stored in transactions. Therefore, you can compare old and new values between the local datasource and transactions.

     

    If you have any further question about IgxGrid, please let me know.

Children
No Data