var addformEData = new Ext.form.FormPanel({
xtype: "form",
labelWidth: 100, // label settings here cascade unless overridden
//url: '../Apis/Treatment.aspx?sid=' + Sys.sid,
frame: true,
//title: 'Simple Form',
//bodyStyle: 'padding:5px 5px 0',
width: 700,
autoDestroy:true,
height: 800,
//waitMsgTarget: true,
items:[{
//defaults: { width: 210 },
columnWidth: .5,
layout: 'form',
defaults: { width: 210 },
autoDestroy: true,
items: [{
id:"id",
xtype: 'textfield',
fieldLabel: 'ID',
name: 'id',
anchor: '95%',
hidden:true
},{
id:"Title",
xtype: 'textfield',
fieldLabel: '标题',
name: 'Title',
anchor: '95%'
}, {
xtype: 'combo',
fieldLabel: '优先级',
hiddenName: 'Priority',
editable: false,
forceSelection: true,
//typeAhead: true,
triggerAction: "all",
editable: false,
anchor: '50%',
store: storeNoicePriority,
displayField: "Text",
valueField: "ID"
},{
xtype: 'datefield',
fieldLabel: '发布日期',
name: 'PublishDate',
id:'PublishDate',
emptyText: new Date().format('Y-m-d'),
anchor: '95%',
format: 'Y-m-d'
}, {
xtype:'htmleditor',
id:'Content',
fieldLabel:'内容',
height:350,
anchor:'98%',
name:'Content'
}]
}]
});
// 优先级状态
var storeNoicePriority = new Ext.data.Store({
// destroy the store if the grid is destroyed
autoDestroy: true,
autoLoad: true,
// load remote data using HTTP
url: '../Apis/BaseData.aspx?actionName=GetNoticePriority',
// specify a XmlReader (coincides with the XML format of the returned data)
reader: new Ext.data.JsonReader({
// records will have a 'plant' tag
record: 'plant',
// use an Array of field definition objects to implicitly create a Record constructor
idProperty: 'ID',
root: 'rows',
totalProperty: 'results',
fields: [
{ name: "ID", mapping: "ID" },
{ name: 'Text', mapping: 'Text' },
]
}),
sortInfo: { field: 'ID', direction: 'ASC' }
});
取值:var priority = addformEData.find("hiddenName","Priority")[0].getValue()
- 本文标题: ExtJS combo 从数据库抽取数据动态绑定下拉菜单及获取值
- 文章分类:【JQuery/JavaScript】
- 非特殊说明,本文版权归【胡同里的砖头】个人博客 所有,转载请注明出处.