Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Extjs 将网格移动和大小调整值保存到状态和会话中_Extjs_Extjs4.1_Extjs Mvc - Fatal编程技术网

Extjs 将网格移动和大小调整值保存到状态和会话中

Extjs 将网格移动和大小调整值保存到状态和会话中,extjs,extjs4.1,extjs-mvc,Extjs,Extjs4.1,Extjs Mvc,我想将状态值保存到数据库中,而不是保存在cookie中。每当特定页面再次加载时,我希望它将数据从state加载到网格中。例如,若用户拖放列,定位并保存到数据库中,或者若更改列宽,则将列宽和保存到数据库中以备将来使用 请任何人指导我,如何管理状态 非常感谢。如果您希望在数据库中持久化并呈现持久化的列位置,则需要将列配置为动态。请参考下面的示例以供参考 // below array of object should be formatted from database and assing to v

我想将状态值保存到数据库中,而不是保存在cookie中。每当特定页面再次加载时,我希望它将数据从state加载到网格中。例如,若用户拖放列,定位并保存到数据库中,或者若更改列宽,则将列宽和保存到数据库中以备将来使用

请任何人指导我,如何管理状态


非常感谢。

如果您希望在数据库中持久化并呈现持久化的列位置,则需要将列配置为动态。请参考下面的示例以供参考

// below array of object should be formatted from database and assing to variable columnpos.


var columnPos = [
    { text: 'Name1',  dataIndex: 'name', width:100 },
    { text: 'Email1', dataIndex: 'email', flex: 1 , width:200},
    { text: 'Phone1', dataIndex: 'phone', width:300 }
    ]

Ext.create('Ext.grid.Panel', {
    title: 'Simpsons',
    store: Ext.data.StoreManager.lookup('simpsonsStore'),
    columns: columnPos,
    height: 200,
    width: 400,
    renderTo: Ext.getBody()
});
谢谢,这会有用的