日期:2014-05-16 浏览次数:20734 次
var combo = new Ext.form.ComboBox({
   width:127,
   height:50,
   renderTo:'div_com',
   mode:'remote',
   triggerAction:'all',
   id:'filiale',
   name:'filiale',
   value:'请选择..',
   allowBlank: false,
   handleHeight:5,
   listWidth :150,
   maxHeight:100,
   readOnly:true,
   valueFiled:'fid',
   displayField:'title',
   store:new Ext.data.JsonStore({
       url: '../../MyPages/Colligate/UploadFiliale.aspx?id='+encodeURI(v),
       root: 'data',
       fields: ['title','fid']
   }),
   listeners:{
       'select':function(arg){
           var d = arg.value;
           alert(Ext.get("filiale").dom.value);
           alert(Ext.getCmp("filiale").getValue());
       }
   }
});
var combo = new Ext.form.ComboBox({
     id:'filiale',
     fieldLabel:"所在组",
     hiddenName:"groupId",  // 下拉框在 HTML 中显示的名称
      allowBlank :false,
     width:201,
     selectOnFocus:true,
     valueField:"fid",      // 提交表单时,下拉框的值
      displayField:'title',   // 显示在页面上下拉框的值
      emptyText:'请选择..',
     editable:false,
     mode:"local",
     forceSelection:true,
     triggerAction:'all',
     allowBlank:false,
     store: new Ext.data.JsonStore({
          // 动态从后台提取数据并填充到 ComboBox
          autoLoad:true,
          fields: ['fid', 'title'],
          url: '../../MyPages/Colligate/UploadFiliale.aspx?id='+encodeURI(v),
     }),
     typeAhead: true,
     listeners:{
         select  :function(combo,record,index){
              alert(combo.value);
         }
     }        
});