数据格式:
1var folders=[{'folderId':'1','folderName':'收信箱'},{'folderId':'2','folderName':'发信箱'}];
2
3//用于下拉列表的store
4var foldersJsonStore = new Ext.data.SimpleStore({
5 fields: [{name: 'folderId', mapping:'folderId'},{name: 'folderName', mapping:'folderName'}],
6 data: folders
7});
刷新数据:
1foldersJsonStore.loadData(folders);
下拉框组件:
1var combo = new Ext.form.ComboBox({
2 fieldLabel: '文件夹',
3 name: 'folderMoveTo',
4 store: foldersJsonStore,
5 displayField: 'folderName',
6 valueField: 'folderId',
7 mode: 'local',
8 typeAhead: true, //自动将第一个搜索到的选项补全输入
9 triggerAction: 'all',
10 emptyText: '全部',
11 selectOnFocus: true,
12 forceSelection: true
13})
--------------------
WE准高手
posted on 2008-03-28 15:07
大卫 阅读(5618)
评论(4) 编辑 收藏 所属分类:
JavaScript