日期:2014-05-16  浏览次数:20615 次

ext下拉列表处不来,请各位帮看看

<!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>
Ext Html

------解决方案--------------------
applyTo:'combo', 
要用renderTo:‘combo’

<div id ="combo"></div>