我希望能够在刷新页面时加载Ext JS ComboBox中最后选择的任何选项。目前,下面的代码每次只加载第一个选项“all”。我知道有一个localStorage代理,但不确定如何将其实现到这段代码中。下面是我所做的:
let stageFilterCombo = Ext.create("Ext.form.field.ComboBox", {
height: 38,
cls: "arrowCls ro-dropdown-ui br-5 stageFilterDropdownUI",
labelAlign: 'left',
itemId: "PACK_STAGE_FILTER_COMBO",
labelSeparator: "",
labelWidth: 15,
originalIdx: 2,
hidden: isPackForEntity,
margin: '0 15',
displayField: "name",
valueField: "value",
editable: false,
width: 190,
name: "groupBy",
value: "all",
store: Ext.create("Ext.data.Store", {
fields: ["name", "value"],
data: [{
"name": "Show : All Packs",
"pickerName": "All Packs",
"value": "all"
}, {
"name": "Show: Ongoing",
"pickerName": "Ongoing",
"value": "ongoing"
}, {
"name": "Show: Completed",
"pickerName": "Completed",
"value": "completed"
}
]
}),
}
如果我选择“完成”,我希望它再次加载“完成”,一旦我回到这个组合框过滤器的地方。任何帮助将不胜感激!
1条答案
按热度按时间yws3nbqq1#
您可以使用cookie:
https://fiddle.sencha.com/fiddle/3f2i