OMID
OMID

Reputation: 2739

Save or cache selected columns by columnChooser on devextreme DataGrid

How can i save or cache selected columns in devextreme datagrid for each user? by cookie, session, in database or anything else...! the problem is users select what they want or need but by page reloading everything will reset!

Upvotes: 1

Views: 1380

Answers (2)

Ramil Aliyev 007
Ramil Aliyev 007

Reputation: 5452

If you use Angular Js, you need add this code to config as below

stateStoring: {
     enabled: true
}

If you store data in localStorage

stateStoring: {
     enabled: true,
     type: "localStorage",
     storageKey: "storage"//This is localStorage's item key
}
    

For more information, please visit this link Devextreme Datagrid State Persistence in Angular Js

If you use Angular 2+, you can use dxo-state-storing component.For more information, please visit this link : Devextreme Datagrid State Persistence in Angular 2+

Upvotes: 0

OMID
OMID

Reputation: 2739

Add this to grid Config:

stateStoring: {
   enabled: true
}

Upvotes: 2

Related Questions