首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

Ext上来框中的“全部”

2012-09-08 
Ext下来框中的“全部”一:Ext的Combox数据一般是后台返回的,但是后台返回的,一般不带有全部。 例如:后台返回:

Ext下来框中的“全部”

一:

 

Ext上来框中的“全部”

 

Ext的Combox数据一般是后台返回的,但是后台返回的,一般不带有全部

 

例如:

后台返回:

上海团队

山东团队

浙江团队

 

前台需求:

全部

上海团队

山东团队

浙江团队

 

二:代码

 

var regionStore = new Ext.data.Store({
   proxy : new Ext.data.HttpProxy({
    api : {
     read : 'remoteAction!getPage.action'
    }
   }),
   reader : new Ext.data.JsonReader({
    totalProperty : 'total',
    root : 'data'
   }, [ {
    name : 'regionId',
    mapping : 'REGION_ID'
   }, {
    name : 'regionDesc',
    mapping : 'REGION_DESC'
   } ]),
   listeners : {
    load : function() {
     var r = new regionStore.recordType({
      regionId : '-1',
      regionDesc : '全部'
     });
     regionStore.insert(0, r);

    //设置combox选中全部
     Ext.getCmp('id_region_combobox').setValue('-1');
    }
   },
   autoSave : false
  });

 

 

 

热点排行