[ExtJs 2.02] Combobobox 사용

2553 단어 htmlext
1. 간단한 사용:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>ComboBox</title>

		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="this is my page">
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">

		<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
		<link rel="stylesheet" type="text/css"
			href="resources/css/ext-all.css" />
		<script type="text/javascript" src="lib/ext-base.js"></script>
		<script type="text/javascript" src="lib/ext-all.js"></script>
		<script type="text/javascript"
			src="lib/ext-lang-zh_CN.js"></script>
		
<script type="text/javascript">
Ext.onReady(function(){
var CountryCode = [
    ['93','Afghanistan(93)'],
    ['355','Albania  (355)'],
    ['213','Algeria  (213)'],
    ['684','American Samoa  (684)'],
    ['376','Andorra  (376)'],
    ['244','Angola  (244)']
]
var cbb =new Ext.form.ComboBox({
el:'cbb',
emptyText:' ...',
                fieldLabel: 'Country Code',
                name:'Country Code',
                forceSelection: true,
                listWidth: 200,
                store: new Ext.data.SimpleStore({
                    fields: ['value', 'text'],
                    data : CountryCode
                    }),
                valueField:'value',
                displayField:'text',
                typeAhead: true,
                mode: 'local',
                triggerAction: 'all',
                selectOnFocus:true,// , 
                allowBlank:false
            })
cbb.render();
});
</script>
	</head>

	<body>
	<input id='cbb'/>
	</body>
</html>

주의: 여기 있는 엘에 대응하는 요소는div가 아니라 input입니다.
fieldLabel 요소는 단독으로 사용할 때 작용하지 않으며form에서만 작용한다

좋은 웹페이지 즐겨찾기