// simple data source
var store2 = new Ext.data.SimpleStore({
fields : ['name', 'age'],
data : [['赵本山', 22], ['井冈山', 28], ['何文', 88], ['注兴', 68]]
});
// simple combobox test
var simpleComboBox = new Ext.form.ComboBox({
store : store2, // 数据源
displayField : 'age', // 数据显示列名
mode : 'local', // 默认以'remote'作为数据源
triggerAction : 'all', // 单击下拉按钮时激发事件
typeAhead : true, // 自动完成功能
// forceSelection: true, //用户不能添加新项,默认为false
selectOnFocus : true,
emptyText : 'select a state ...',
applyTo : 'simpleComboBox' // 请注意此项设置显示下拉列表的控件(
// />)
});
var simplePanel = new Ext.Panel({
contentEl : 'simplePanelCode', // 面板内容
renderTo : 'simplePanel', // 呈现的目标控件
title : 'simple panel', // 面板标题
width : Ext.getBody().child('p').getWidth(), // 面板宽度
collapsed : true,
titleCollapse : true,
hideCollapseTool : false,
collapsible : true
});
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12685933/viewspace-223936/ ,如需转载,请注明出处,否则将追究法律责任。