ExtJS combo 从数据库抽取数据动态绑定下拉菜单及获取值
来源:互联网 发布:如何开通淘宝旺铺 编辑:程序博客网 时间:2024/05/16 06:21
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()
本文来自: 小胡设计室(http://www.xhsjs.com/),专业代做ASP.NET毕业设计 详细出处参考:http://www.xhsjs.com/NET/ZhiShi/100000771.shtml
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()
本文来自: 小胡设计室(http://www.xhsjs.com/),专业代做ASP.NET毕业设计 详细出处参考:http://www.xhsjs.com/NET/ZhiShi/100000771.shtml
- ExtJS combo 从数据库抽取数据动态绑定下拉菜单及获取值
- Extjs combo数据绑定与获取
- 下拉菜单从数据库读取数据动态生成
- 从数据库获取下拉菜单数据 原生连接mysql语句
- ExtJs 动态改变combo显示数据
- [EXTJS]combo下拉框可多选
- 下拉框中的值从数据库动态获取
- EXTJS combo下拉框插入脚本生成的数据
- 动态二级下拉框联动(二级数据从数据库中获取)
- Extjs combo 两级菜单联动
- select标签,拉下获取数据,数据从数据库获取绑定
- MVC中动态绑定下拉菜单
- 毕设笔记--SSH前台JSP页面下拉列表框的值从数据库动态获取
- EasyUI从数据库获取数据填充下拉框
- extjs--form combo下拉列表框
- Extjs的下拉框combo传多个值到后台
- 从数据库读取数据动态生成树形菜单示例
- 对Extjs“Combo with Templates and Ajax”改进(下拉数据中添加图标标识)
- 浅谈SEO的弊端
- 看了IPhone4s发布会的感触
- 面向对象基础1的补充
- ansys模型导入到abaqus
- 2011国庆总结——代码不是写出来的,是设计出来的
- ExtJS combo 从数据库抽取数据动态绑定下拉菜单及获取值
- Java中的类、方法、属性的命名规则
- 我唱出心里话时眼泪会流,要是怕难过抱住我手。
- vb.net 在一个窗体中,可不可以RaiseEvent另一个窗体(或者Class)中的事件?
- cts的学习
- 打造自己的标签栏
- 软件架构师成长之路
- 苹果iMac和lion的使用体验
- 【生活随笔】武侠--三感