var UserCombox=new Ext.form.ComboBox({
tpl: '<tpl for="."><div ext:qtip="{LoginName}" class="x-combo-list-item">{LoginName}</div></tpl>',
store: storeUser,
typeAhead: true,
fieldLabel:'登录名',
forceSelection: true,
triggerAction: 'all',
emptyText:'请选择一个用户',
selectOnFocus:true,
anchor:"94%",
editable: false,
allowBlank:false,
blankText:'请选择一个用户',
displayField:'LoginName',
valueField: 'LoginName',
name:"LoginName",
mode: 'remote'
});
var BookPanel=new Ext.FormPanel({
columnWidth:.25,
layout:"form",
xtype:"panel",
frame:true,
height:panelHeight,
style:"margin-left:1px",
title:"基本信息登记",
defaultType:"textfield",
labelWidth:60,
items:[
{ fieldLabel:"借阅单号",anchor:"94%",name:"BorrowNo",readOnly:true },
UserCombox,
new Ext.form.DateField({
name:"BorrowDate",
fieldLabel:"借阅时间",
allowBlank:true,
emptyText:"请选择",
format:"Y-m-d", // Y-m-d:2009-06-06 y-m-d:09-06-06
disabledDays:[0,7],
anchor:"94%",
allowBlank:false
}),new Ext.form.NumberField({
id:"BookNum",
name:"BookNum",
fieldLabel:"借书数量",anchor:"94%",
maxValue:10,minValue:0,
readOnly:true,
value:0
}),
{ fieldLabel:"管理员",anchor:"94%",name:"BookMamage" }
]
});
//============================遍历方法
alert( BookPanel.items);
BookPanel.items.each(function(item,index,length){
alert(item.getName());
alert(item.initialConfig.name);
alert(item.initialConfig.id);
alert(item.initialConfig.emptyText);
alert(item.getValue());
alert(item.getXType());
});