<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Contact Form</title>
<!-- ExtJS --> <script type="text/javascript" src="../../locale/ext-lang-zh_CN.js"></script> <script type="text/javascript" src="../../bootstrap.js"></script>
<!-- Shared --> <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
<!-- GC -->
<!-- Example --> <script type="text/javascript">
Ext.onReady(function(){
Ext.regModel('PostInfo',{
fields:[{name:'province'},{name:'post'}]
});
var postStore=Ext.create('Ext.data.Store',{
model:'PostInfo',
data:[
{ province:'北京',post:'100000'},
{province:'北京',post:'100000'},
{province:'北京',post:'100000'},
{province:'北京',post:'100000'},
{province:'北京',post:'100000'},
{province:'北京',post:'100000'},
{province:'北京',post:'100000'},
{province:'北京',post:'100000'},
{province:'北京',post:'100000'},
{province:'北京',post:'100000'}]
});
Ext.create('Ext.form.Panel',{
title:'Ext.form.field.comboBox本地数据显示',
renderTo:Ext.getBody(),
bodyPadding:5,
frame:true,
height:100,
width:270,
defaults:{
labelSeparator:':',
labelWidth:70,
width:180,
labelAlign:'right'
},
items:[{
xtype:'combo',
listConfig:{
emptyText:'未找到匹配值',
maxHeight:60
}, name:'post',
fieldLabel:'邮政编码',
triggerAction:'All',
store:postStore,
displayField:'province',
valueField:'post',
queryMode:'local',
forceSelection:true,
typeAhead:true,
value:'100000'
}]
});
});
</script>
<style type="text/css"> </style> </head> <body> <div id='form'></div> </body> </html>