存储cookie中的列宽

时间:2012-07-17 09:50:48

标签: cookies extjs grid

我正在使用extjs网格,并希望为用户存储列的顺序和宽度。 我添加了:

var dateExpires = new Date().getTime()+(1000*60*60*24*300);
Ext.state.Manager.setProvider(new Ext.state.CookieProvider({
expires: new Date(dateExpires) //300 days from now
}));

现在是存储的列的顺序,但仍然缺少列的大小。我不使用forcefit,因为我看到这可能是一个问题。

这就是列的样子

{
 xtype: 'gridpanel',
 id: 'GridPanel',
 titleCollapse: false,
 store: 'gridStore',
 stateId: 'gridPanelState',
 region: 'center',
 viewConfig: {},
 columns: [
                    {
                        xtype: 'gridcolumn',
                        dataIndex: 'vehicle',
                        text: 'Vehicle'
                    },

                    {
                        xtype: 'gridcolumn',
                        dataIndex: 'speed',
                        text: 'Speed'
                    },
                    {
                        xtype: 'gridcolumn',
                        dataIndex: 'routeId',
                        text: 'RouteId'
                    },
                    {
                        xtype: 'gridcolumn',
                        dataIndex: 'direction',
                        text: 'Direction'
                    },
                    {
                        xtype: 'gridcolumn',
                        dataIndex: 'description',
                        text: 'Description'
                    }
                ],

0 个答案:

没有答案
相关问题