本帖最后由 fan123123 于 2011-07-12 17:58:11 编辑

解决方案 »

  1.   

    你用本地store先试试看嘛,也许没有取到数据呢
      

  2.   

    我把打印结果写在本地,也不行!而且按“增加”按钮,对话框也出不来,结果把 valueField : 'LJDM',
    项屏蔽,就可以弹出了,但是还是没有数据,无奈
      

  3.   


    var fields = ['id','fullname'];
    var jsonUrl = '<c:url value="whitelistManager/getGNameForWhite.html"/>';
    var gNameStore = new Ext.data.JsonStore({
    proxy: new Ext.data.HttpProxy({
        url:jsonUrl
    }),
    root:'data',
    fields:fields
    });
    gNameStore.load();
    this.combo = new Ext.form.ComboBox({
    fieldLabel:'<fmt:message key="whitelist.groups.fullname"/>',
    anchor:'95%',
    store:gNameStore,
    mode: 'remote',
    name:'whitelist.groups.id',
    triggerAction: 'all',
    typeAhead: true,
    monitorValid:true,
    hiddenName:'whitelist.groups.id',
    displayField: 'fullname',
    forceSelection:true,
    valueField: 'id',
    allowBlank:false,
    editable: false,
    blankText:'<fmt:message key="whitelist.groupsFullname.blankText"/>',
    selectOnFocus: true,
    emptyText:'<fmt:message key="whitelist.groupsFullname.emptyText"/>',
    listeners:{
         select : function(c, r, index){
             var gId = this.combo.getValue();
            if(gId){
             var wlid = this.getForm().findField('whitelist.wlid').getValue();            
    this.myStore.baseParams = {gId:gId,wlid:wlid};
    this.myStore.proxy = new Ext.data.HttpProxy({
    url: '<c:url value="groupinfoManager/queryProductMap.html?gId="/>'+gId,
    method: 'post'
    });
    this.myStore.load({params:{start:0, limit:15}});
        } 
                },
                scope:this
                 }
      })  
    name:'whitelist.groups.id',hiddenName:'whitelist.groups.id', 都是你的业务实体类的属性
    而displayField: 'fullname',valueField: 'id',分别是你查询出的json数据的ID和要显示的信息你修改下 试试
      

  4.   

    您好,感谢您的关注,我仔细查了一下,似乎还是看不出哪错了。但是我用这个store,用EditorGridPanel均能列出值,说明store没有问题。但是就是在下拉框中没有值。{
          xtype:'combo',
           width:80,
          allowBlank:false,
          blankText:'请选择局代码',
          hiddenName:'JDM',
          name:'JDM',
          store:jdmStore,
          editable : false,
          loadingText : '加载中...',
      displayField:'HZJM',
      valueField : 'LJDM', //-------这句不屏蔽就无法弹出框。
      emptyText :'请选择',
      mode: 'remote',
          fieldLabel:'&nbsp;局&nbsp;代&nbsp;码&nbsp;'
         }恳请您帮我实际测试一下,搞了好几天了,就卡这了。唉!多谢多谢!
      

  5.   

     {
    fieldLabel:"需求类型",
    name : "REQTYPE",
    hiddenName : "REQTYPE",
    id : "REQTYPE_ID",
    xtype : "combo",
    width : 200,
    mode : "local",
    editable : false,
    triggerAction : "all",
       store : new huiStroe("REQTYPE")
      ,displayField:"dictName", valueField:"dictId"
    }//字典表翻译
    var huiStroe = function(dict,isALL)
    {
    var a = new Ext.data.JsonStore({
    autoLoad:true, 
    url:__ctxPath + "/dictInfo.do?method=queryByType4&type="+dict,
    root: 'response.data',
    fields:["dictId", "dictName"],
    listeners:{   
    //向已有数据中插入一条新的数据   
    load : function(store, records, options ){  
    if(isALL)
    {
    var data = {'dictId':'','dictName':'请选择'};   
    var rs = [new Ext.data.Record(data)];   
    store.insert(0,rs);
    }
    }   
    }   
    }
    );
    return a;
    };
      

  6.   

    将 store的定义 放在 comb之前
      

  7.   

    您太NB了,我刚无意间把store定义放到前面,问题迎刃而解啦,超N!
    谢谢(北冰洋之风) ,谢谢(烟雨朦胧),谢谢 TV。结贴。