asp.net-mvcdevexpressdevextremedevexpress-mvc

Save Devextreme Pivot grid to database


I am using Devextreme js components. I am loading data to Devextreme PivotGrid component and I want to save PivotGrid to my database. I saw PivotGridSettings in Devexpress. I wonder that may I use that class in my MVC project. By the way I storaged PivotGrid to browser local storage. I wonder any way except of using Local storage? Thanks in advance


Solution


  • PivotGrid provides the stateStoring option. It helps you store the PivotGrid's settings.
    For example, when this option is enabled, PivotGrid stores its settings in a browser's local storage.
    If you want to store them in your database, use the custom type of storage. Just define actions on saving and loading a state via specifying the customSave and customLoad callback functions. Send the JSON state to your database on customSave and then apply it to the PivotGrid back on customLoad.
    You can find more information about the stateStoring feature in the DevExtreme documentation.
    By the way, this is Demo where you can try it.