Ext 로드 드롭다운 상자 지정

var year_select = new Ext.form.ComboBox({
id : 'year_select',
fieldLabel : " ",
hiddenName : "year", // HTML
allowBlank : false,
width : 100,
selectOnFocus : true,
valueField : "store", // ,
displayField : 'storeYear', //
emptyText : ' ..',
editable : false,
mode : "local",
forceSelection : true,
triggerAction : 'all',
anchor : '85%',
store : new Ext.data.JsonStore({
// ComboBox
autoLoad : true,
fields : [{
name : 'store',
type : 'int'
}, {
name : 'storeYear',
type : 'int'
}],
url : '/erips/portfolio/srcs/getYears.htm',
root : 'root',
totalProperty : 'totalCount',
successProperty : 'success',
failure : function() {
Ext.Msg.alert(" ! ");
}
}, []),
typeAhead : true,
listeners : {
select : function(combo, record, index) {
alert(combo.value);
}
}
});

여기서 controller에서 얻은 값은: {"success":true, "totalCount": 1, "root":[2009]}
 
 
var combo = new Ext.form.ComboBox({width:127,height:50,renderTo:'div_com', mode:'remote', trigger Action:'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({ure l:'..././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()); } } });

좋은 웹페이지 즐겨찾기