combobox下拉表格
来源:互联网 发布:网络胜利组动漫风车 编辑:程序博客网 时间:2024/06/05 21:56
var portComboBox = new Ext.form.ComboBox({
id: "Client_Name",
name: "CustomerName",
fieldLabel: "名称<font color='red'>*</font>",
mode: "local",
valueField: "Id",
selectOnfocus: true,
allowBlank: false,
displayField: "Name",
triggerAction: "all",
listWidth: 500,
pageSize: 20,
anchor: "60%",
tpl: '<div id="portListPanel" style= "height:200px;width:144px;"></div> ',
store: new Ext.data.SimpleStore({ fields: [], data: [[]] }),
listeners: {
specialKey: function(field, e) {
if (e.getKey() == Ext.EventObject.ENTER) {
return;
}
},
change: function(field, newvalue, oldvalue) {
}
});
} //end change:
}
}); //var portComboBox
var portPanel;
//实现collapse 事件
portComboBox.on("collapse", function() {
if (portPanel != null || portPanel != undefined) {
portPanel.destroy();
}
});
portComboBox.on("expand", function() {
var comboboxvalue = portComboBox.getEl().dom.value;
var fieldDirection =
[
{ name: "Id" },
{ name: "Name" }
]
var cmDirection = new Ext.grid.ColumnModel
([
new Ext.grid.RowNumberer({ header: "序号", width: 35 }),
{ header: "代号", dataIndex: "Id", width: 50 },
{ header: "名称", dataIndex: "Name", width: 45 }
]);
//定义数据源
var Storedirector = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({ url: "ApplyJson.aspx?Param=get" }),
reader: new Ext.data.JsonReader({ fields: fieldDirection, totalProperty: "totalProperty", root: "root" }),
baseParams: { cusname: comboboxvalue }
});
portComboBox.pageTb.bindStore(Storedirector);
Storedirector.reload();
// var button = Ext.getForm("update")
portPanel = new Ext.grid.GridPanel
({
id: "portPanel",
region: "center",
layout: "fit",
renderTo: "portListPanel",
frame: true,
border: true,
cm: cmDirection,
viewConfig: { forceFit: true },
sm: new Ext.grid.RowSelectionModel({ singleSelect: true }),
autoScroll: true,
height: 200,
width: 510,
store: Storedirector,
listeners:
{
cellclick: function() {
var rows = Ext.getCmp("portPanel").getSelectionModel().getSelections();
if (rows.length >= 1) {
Ext.getCmp("Name").setValue(rows[0].get("Name"));
var ApplyForm = Ext.getCmp("Apply_Form").getForm();
ApplyForm.findField("CustomerID").setValue(rows[0].get("Id"));
Client_portComboBox.collapse();
}
},
keydown: function(e) {
var rows = Ext.getCmp("portPanel").getSelectionModel().getSelections();
if (e.getKey() == Ext.EventObject.ENTER) {
portComboBox.collapse();
}
}
}//listeners
}); //portPanel = new Ext.gridPanel
}); // portComboBox
id: "Client_Name",
name: "CustomerName",
fieldLabel: "名称<font color='red'>*</font>",
mode: "local",
valueField: "Id",
selectOnfocus: true,
allowBlank: false,
displayField: "Name",
triggerAction: "all",
listWidth: 500,
pageSize: 20,
anchor: "60%",
tpl: '<div id="portListPanel" style= "height:200px;width:144px;"></div> ',
store: new Ext.data.SimpleStore({ fields: [], data: [[]] }),
listeners: {
specialKey: function(field, e) {
if (e.getKey() == Ext.EventObject.ENTER) {
return;
}
},
change: function(field, newvalue, oldvalue) {
}
});
} //end change:
}
}); //var portComboBox
var portPanel;
//实现collapse 事件
portComboBox.on("collapse", function() {
if (portPanel != null || portPanel != undefined) {
portPanel.destroy();
}
});
portComboBox.on("expand", function() {
var comboboxvalue = portComboBox.getEl().dom.value;
var fieldDirection =
[
{ name: "Id" },
{ name: "Name" }
]
var cmDirection = new Ext.grid.ColumnModel
([
new Ext.grid.RowNumberer({ header: "序号", width: 35 }),
{ header: "代号", dataIndex: "Id", width: 50 },
{ header: "名称", dataIndex: "Name", width: 45 }
]);
//定义数据源
var Storedirector = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({ url: "ApplyJson.aspx?Param=get" }),
reader: new Ext.data.JsonReader({ fields: fieldDirection, totalProperty: "totalProperty", root: "root" }),
baseParams: { cusname: comboboxvalue }
});
portComboBox.pageTb.bindStore(Storedirector);
Storedirector.reload();
// var button = Ext.getForm("update")
portPanel = new Ext.grid.GridPanel
({
id: "portPanel",
region: "center",
layout: "fit",
renderTo: "portListPanel",
frame: true,
border: true,
cm: cmDirection,
viewConfig: { forceFit: true },
sm: new Ext.grid.RowSelectionModel({ singleSelect: true }),
autoScroll: true,
height: 200,
width: 510,
store: Storedirector,
listeners:
{
cellclick: function() {
var rows = Ext.getCmp("portPanel").getSelectionModel().getSelections();
if (rows.length >= 1) {
Ext.getCmp("Name").setValue(rows[0].get("Name"));
var ApplyForm = Ext.getCmp("Apply_Form").getForm();
ApplyForm.findField("CustomerID").setValue(rows[0].get("Id"));
Client_portComboBox.collapse();
}
},
keydown: function(e) {
var rows = Ext.getCmp("portPanel").getSelectionModel().getSelections();
if (e.getKey() == Ext.EventObject.ENTER) {
portComboBox.collapse();
}
}
}//listeners
}); //portPanel = new Ext.gridPanel
}); // portComboBox
- combobox下拉表格
- Ext.form.ComboBox 表格下拉最终版本
- 把combobox下拉选项显示成一个表格
- miniui表格下拉树combobox使用方法与全选或选某一个
- 下拉列表:comboBox控件
- ComboBox下拉显示
- 美化ComboBox下拉
- ComboBox下拉列表
- EXTjs 禁止comboBox 下拉
- ExtJs combobox 下拉图标
- iOS 下拉选择 comboBox
- ComboBox自定义下拉控件
- javascript表格jqGrid下拉ComboBox,jqGrid弹出窗jquery.dialog,jqGrid回车换行编辑切换单元格,jqGrid提交全部表格数据ajax
- flash CS3 在Datagrid(表格组件)中加入Button(按钮)、checkbox(复选框)、combobox下拉框、combotree(树状下拉框)等组件
- combobox(下拉框外部数据)
- combobox 添加颜色下拉框
- Combobox弹出下拉的dataGridView
- 下拉列表comboBox的使用
- 深入了解ibatis源码----简单ibatis示例代码
- 单机redis 主从实例
- redis java对象操作
- redis session共享中的序列化问题
- jQuery Bootstrap框架
- combobox下拉表格
- eclipse git 地址
- 处理Main方法中传入的参数--通过阅读Jmeter的源码分析得到
- Nifti and epuck test @asl
- css中注释+jquery
- 转载:MFC文件/文件夹操作查找、复制、删除
- ASIHTTPRequest 保存请求数据
- FlashBuilder生成ASDOC文档
- AndroidManifest中的largeHeap的作用