angular-ui / ui-grid

UI Grid: an Angular Data Grid
http://ui-grid.info
MIT License
5.39k stars 2.47k forks source link

Multi Language support for savestate / set own identifier Variable #7185

Closed prx-lmo closed 3 years ago

prx-lmo commented 3 years ago

The "name" property of an column changes based on which language is currently loaded. This breaks the savestate feature, because it identifies the needed columns by their name. To keep track of what column corresponds to what I give the columns an "id" property. I'd like to have a new option, which sets the used identifier, it defaults to "name". Legacy support must be kept in mind. My solution for that would be a flag property which contains the new identifier. Setting this new identifier is here: https://github.com/angular-ui/ui-grid/blob/863c820267ea71fecbcbdf1d2e9e6d83a8fe500d/packages/saveState/src/js/saveState.js#L351 And loading it occurs here: https://github.com/angular-ui/ui-grid/blob/863c820267ea71fecbcbdf1d2e9e6d83a8fe500d/packages/saveState/src/js/saveState.js#L559 For restoring a column a new function is needed, something along the lines of "findColumnByVariable". It would be similar to #4457. Overall this isn't as massive as it seems. I'm currently planning to implement this over the next week.