>  기사  >  웹 프론트엔드  >  ext下拉列表处不来,请各位帮看看_html/css_WEB-ITnose

ext下拉列表处不来,请各位帮看看_html/css_WEB-ITnose

WBOY
WBOY원래의
2016-06-24 12:25:26801검색

Ext Html

<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Insert title here</title><link rel = "styleSheet" type = "text/css" href = "../extjs/resources/css/ext-all.css"/><script type = "text/javascript" src = "extjs/adapter/ext/ext-base.js"></script><script type = "text/javascript" src = "extjs/ext-all.js"></script><script type="text/javascript">	Ext.onReady(function(){		var data = [		            ['value1','text1'],		            ['value2','text2'],		            ['value3','text3']		];			var store = new Ext.data.SimpleStore({		fields:['value','text'],		data:data	});var combo = new Ext.form.ComboBox({	store:store,	emptyText:'请选择',	mode:'local',	triggerAction:'all',	valueField:'value',	displayField:'text',	applyTo:'combo',	value:'text1'});});	</script></head><body>	<input  id = "combo" type = "text"></body></html>

回复讨论(解决方案)

SimpleStore 改成ArrayStore

applyTo:'combo', 
要用renderTo:‘combo’

var store = new Ext.data.ArrayStore({
fields:['value','text'],
data:data
});
还没有效果

applyTo:'combo', 
要用renderTo:‘combo’


就不是下拉列表

自己找到原因

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.