Flexicious has a robust persistence preference mechanism that "just works" out of the box, but the preferences are stored on the client machine's localstorage by default. This enables the preference persistence mechanism to work without any additional coding on the part of the developers utilizing the library. While this may be sufficient for most people, this will not work in scenarios when the same user uses multiple machines to access your application, or if multiple users access the application using the same machine. For this, you will need to store preferences in the backend, and this post aims to show you how this is done. Attached is a simple example that you can plug into the demo console you got when you downloaded a trial (or purchased a license).
If you look at ServerPreferencesjs it shows the JS code require to enable server based persistence of preferences: Please note the declaration of the grid - we wire up 3 events, loadPreferences, persistPreferences, and clearPreferences. Each of these events call a service method, which we will talk about in a bit. But the idea is simple, on persistPreferences, we send up the preferences string, the name of the grid, and in your service method, you figure out who the logged in user is (on basis of your security implementation) and store a record in the database with UserID, gridName, and preferences (Make this a large text field (nvarchar(max) in SQL Server Lingo), it could get pretty verbose). the loadPreferences will call your service method to load the preferences you persisted, and set the grids preferences property. Once you set the property, the grid will parse everything and get back to the state it was when the preferences were stored. And then the final method is the clearPreferences, which will basically just wipe out the preferences that were previously stored. Sound like a lot, but really pretty straight forward. In this example, we just store the preferences in a global variable instead of the database.
This example is integrated with out demo console, but you can clean the concepts from the associated files. To run this example, open the project you got in TreeGridTrial.zip and :
1) Add the declaration of the example to the bottom of index.js:
{ id: 'ColumnWidthMode', description:'This example demonstrates support for various column lock modes, none,fixed,percent,and fitToContent', name:'Column Width Mode',parent:'allExamples',dataProvider:myCompanyNameSpace.Employee.getAllEmployees()},
{ id: 'ServerPreferences', description:'This example demonstrates Persisting Preferences on the Server', name:'Server Preferences',parent:'allExamples'}
2) Include the script in index.html:
<script type="text/javascript" src="examples/js/samples/ServerPreferences.js" id="script_ServerPreferences"></script>
3) Copy the file alongside the other sample js files:
HTMLComponents/examples/js/samples/ServerPreferences.js
When you run the demo console, you should see the new example towards the very bottom:

Once you save preferences and load the example again, you should see:

The files are uploaded for your convenience:
ServerPreferences.js (3.71 kb)
index.js (19.57 kb)
index.html (26.29 kb)
And for those of you who are using ASP.Net/jQuery, below is an ASP.net project that demonstrates how to persist preferences on the server. The example does not actually save it to the database, just puts it in the session memory, and you should be able to adapt the backend code to write to your database engine.
ServerPreferencesVisualStudio.zip (10.74 kb)