Home  >  Article  >  Web Front-end  >  The ext drop-down list does not work, please help me_html/css_WEB-ITnose

The ext drop-down list does not work, please help me_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:25:26801browse

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>

Reply to discussion (solution)

Change SimpleStore to ArrayStore

applyTo: 'combo',
To use renderTo: 'combo'

a52263c5f543ea226207593f835cdacc16b28748ea4df4d9c2150843fecfba68

var store = new Ext.data.ArrayStore ({
fields:['value','text'],
data:data
});
has no effect yet

applyTo:'combo',
To use renderTo: 'combo'

a52263c5f543ea226207593f835cdacc16b28748ea4df4d9c2150843fecfba68
It is not a drop-down list

Find out the reason yourself

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn