Tejas
Tejas

Reputation: 272

Get modified column ordering for Extjs GridPanel

As part of gridpanel functionality after rendering the gridpanel I can modify the columns ordering by click drag. For example present column ordering is First Name | Last Name. But I can click drag first name and put it after Last Name i.e now it will be like Last Name | First Name.

Now my requirement is something like I want to save the modified order of the column. i.e i want to save the format change which I have made. So does Extjs functionality provide me with modified ordering of the column.

By tejas,


visit mobedio,The only public opinion platform for political domain.

Upvotes: 2

Views: 3376

Answers (1)

McStretch
McStretch

Reputation: 20645

Take a look at GridPanel's stateEvent, stateId, and stateful config options in the API Documentation.

Concerning stateful:

A stateful Component attempts to save state when one of the events listed in the stateEvents configuration fires.

StateEvents for the GridPanel defaults to stateEvents: ['columnmove', 'columnresize', 'sortchange', 'groupchange'], so your use case will be handled automatically with 'columnmove'. Keep in mind that you'll have to set up a few config options for this to work, including a state provider (most of the details can be found in the 'stateful' documentation).

Upvotes: 2

Related Questions