Ext.form.ComboBox 提交始終獲得displayField的值

var alertLevel = new Ext.form.ComboBox( {
			id:'cmb_alertLevel',
		 	hiddenName:"level",	//提交到後臺的input的name 
			store: new Ext.data.SimpleStore({
		        fields: ['myId', 'displayText'],
		        data: [['0', 'Emergency'], ['1','Alert'],
		        			['2','Critical'],['3','Error'],
		        			['4','Warning'],['5','Notice'],
		        			['6','Informational'],['7','Debug']]
            }),
    		valueField: 'myId',	//option.value
    		displayField: 'displayText', //option.text
			typeAhead : true,
			triggerAction : 'all',
			emptyText : '所有',
			mode: 'local',
			applyTo : 'alertLevel'
		});		

 

重要屬性設置 hiddenName:'level'。  後臺直接通過 String alertLevel = request.getParameter("level");獲取值

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章