PDA

View Full Version : on moveColumn save it's position in grid panel and database



Akanksha S
29 May 2013, 3:44 AM
I want to move columns in Grid Panel and save its position in database so that next time when i login I will get same column reordering in Grid Panel. I am using following function to move column in gridpanel.

columnmove: function (container, coulmn, from, to) {
alert('Column Moved From' + from + 'To' + to);
}

Thanks

slemmon
31 May 2013, 11:37 AM
What is your question? How to send that info to your server?

Akanksha S
12 Jun 2013, 10:19 PM
My question is how to get that info i.e. ColumnPosition on ColumnMove function.

columnmove: function (container, coulmn, from, to) {
alert('Column Moved From' + from + 'To' + to);
}

from and to return index of column But I want sortorder.

slemmon
14 Jun 2013, 1:16 PM
The grids report column order for statefulness presently. The challenge will be restoring the state from your DB. The state is applied when the component is instantiated and will need that information at that (vs- waiting for it to be AJAX'd in).
http://docs.sencha.com/extjs/4.2.1/extjs-build/examples/state/state.html

You might take a look at the example above and see if inspecting the cookie provider or the localstorage provider helps you to know what to record to your DB and what to import from the DB when loading the app so that the information is available to the components when initialized.