主要代码:

 {
header: '属性值',
dataIndex: 'PropertyValueName',
width: 130,
editor: new Ext.form.field.ComboBox({
typeAhead: true,
triggerAction: 'all',
name:'PropertyValueName',
store: comboData_DynaPropertyValue,
valueField: "PropertyValueName",
displayField: "PropertyValueName",
mode: 'remote',//local
editable: false,
triggerAction: 'all',
autoload: true,
listeners: {
"expand": function (combo, store, index) {
var selectedData = grid_DynaProperty.getSelectionModel().getSelection()[0].data;
comboData_DynaPropertyValue.load({
params: {
PropertyId: selectedData.PropertyId, //获取当前选择行的字段ID
start: startDynaProperty,
limit: limitDynaProperty
}
});
}
}
})
}

详细代码:

var startDynaProperty = 0;
var limitDynaProperty = 30;
Ext.define('DynaProperty', {
extend: 'Ext.data.Model',
fields: [
{ name: "PropertyId", type: "int" },
{ name: "PropertyName", type: "string" },
{ name: "PropertyEngName", type: "string" },
{ name: "PropertyValueId", type: "string" },
{ name: "PropertyValueName", type: "float" }
]
}); var store_DynaProperty = Ext.create('Ext.data.Store', {
model: 'DynaProperty',//这个地方DynaProperty不是一个对象,而是一个类
remoteSort: false,
remoteFilter: true,
pageSize: limitDynaProperty, //页容量20条数据
method: 'POST',
proxy: {//代理
type: 'ajax',
url: "/UI/HttpHandlerData/GalleryManagement/GalleryManagement.ashx?operation=SearchPicList",//请求
extraParams: {
start: startDynaProperty,
limit: limitDynaProperty
},
reader: {
type: 'json',
root: 'Table', //根节点
totalProperty: 'result' //数据总条数
}
},
sorters: [{
//排序字段。
property: 'PropertyId',
//排序类型,默认为 ASC
direction: 'ASC'
}],
autoLoad: true //即时加载数据
}); var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
clicksToMoveEditor: 1,
autoCancel: false
}); var comboData_DynaPropertyValue = Ext.create('Ext.data.Store', {
fields: ['PropertyValueId', 'PropertyValueName'],
autoLoad: true,
proxy: {
type: "ajax",
url: '/UI/HttpHandlerData/TrademarkCar/TrademarkCar.ashx?operation=Search',
reader: {
type: "json",
root: "Table"
}
}
}); var grid_DynaProperty = Ext.create('Ext.grid.Panel', {
store: store_DynaProperty,
autoWidth: true,
aotuHeight: true,
animCollapse: false,
enableColumnMove: false,
enableHdMenu: false,
loadMask: true,
loadMask: {
msg: '正在载入数据,请稍候...'
},
viewConfig: {
forceFit: true,
stripeRows: true
},
forceFit: true, //列表宽度自适应
stripeRows: true,//斑马线
autoSizeColumns: true, //根据每一列内容的宽度自适应列的大小
trackMouseOver: true, //鼠标移动时高亮显示
selModel: { selType: 'checkboxmodel' }, //选择框
scroll: true,
plugins: [rowEditing],
columns: [
{ header: '序号', xtype: 'rownumberer', align: 'left', width: 50 },
{
header: '属性', dataIndex: 'PropertyName', width: 200
}, {
header: '填值方式', dataIndex: 'ValueMethod', width: 200
},{
header: '属性值', dataIndex: 'PropertyValueName', width: 200
}, {
header: '属性值',
dataIndex: 'PropertyValueName',
width: 130,
editor: new Ext.form.field.ComboBox({
typeAhead: true,
triggerAction: 'all',
name:'PropertyValueName',
store: comboData_DynaPropertyValue,
valueField: "PropertyValueName",
displayField: "PropertyValueName",
mode: 'remote',//local
editable: false,
triggerAction: 'all',
autoload: true,
listeners: {
"expand": function (combo, store, index) {
var selectedData = grid_DynaProperty.getSelectionModel().getSelection()[0].data;
comboData_DynaPropertyValue.load({
params: {
PropertyId: selectedData.PropertyId, start: startDynaProperty,
limit: limitDynaProperty
}
});
}
}
})
}
]
});

EXTJS 4.2 资料 控件之Grid 行编辑绑定下拉框,并点一次触发一次事件的更多相关文章

  1. 自定义SWT控件二之自定义多选下拉框

    2.自定义下拉多选框 package com.view.control.select; import java.util.ArrayList; import java.util.HashMap; im ...

  2. EXTJS 4.2 资料 控件之Grid 那些事

    最近在学习Extjs4.2 ,积累文章,看得不错,再此留年: //表格数据最起码有列.数据.转换原始数据这3项 Ext.onReady(function(){ //定义列 var columns = ...

  3. EXTJS 4.2 资料 控件之Grid 添加行,编辑行,删除行

    //SiteVariableConfigValue类,创立一个模型类 Ext.define("SiteVariableConfigValue", { extend: "E ...

  4. EXTJS 4.2 资料 控件之Grid Columns 列renderer 绑定事件

    columns: [ { header: '序号', xtype: 'rownumberer', align: 'center', width: 100 }, { header: 'CompanyId ...

  5. EXTJS 4.2 资料 控件之Grid 列鼠标悬停提示

    columns: [ { header: }, { header: }, { header: , renderer: function (v, ctx, record) { ctx.tdAttr = ...

  6. C# 如何定义让PropertyGrid控件显示[...]按钮,并且点击后以下拉框形式显示自定义控件编辑属性值

    关于PropertyGrid控件的详细用法请参考文献: 1.C# PropertyGrid控件应用心得 2.C#自定义PropertyGrid属性 首先定义一个要在下拉框显示的控件: using Sy ...

  7. 用MVC的辅助方法自定义了两个控件:“可编辑的下拉框控件”和“文本框日历控件”

    接触MVC也没多长时间,一开始学的时候绝得MVC结构比较清晰.后来入了门具体操作下来感觉MVC控件怎么这么少还不可以像ASP.net form那样拖拽.这样设计界面来,想我种以前没学过JS,Jquer ...

  8. EXTJS 3.0 资料 控件之 html 潜入label用法

    这是在Extjs 中插入html 控件label! html: "<div><label id='howMany'>您共选中了</label><br ...

  9. EXTJS 4.2 资料 控件之combo 联动

    写两个数据源: 1.IM_ST_Module.js { success:true, data:[ { ModuleId: '1', ModuleName: '资讯' } , { ModuleId: ' ...

随机推荐

  1. 关于使用vss版本管理工具中的sln,suo文件作用

    Visual Studio.NET采用两种文件类型(.sln和.suo)来存储特定于解决方案的设置,它们总称为解决方案文件.为解决方案资源管理器提供显示管理文件的图形接口所需的信息 从而在每次继续开发 ...

  2. 为dedecms v5.7的ckeditor添加jwplayer插件

    dedecms v5.7的默认编辑器是ckeditor,不过用的是php版本的,默认的工具栏不在config.js里面配置,而是在ckeditor.inc.php里面配置,默认的工具栏是$toolba ...

  3. 初识CSS3之媒体查询(2015年05月31日)

    一.什么是媒体查询 媒体查询是面向不同设备提供不同样式的一种实现方式,它可以为每种类型的用户提供最佳的体验,也是响应式设计的实现方式. 现今每天都有更多的手机和平板电脑问市.消费者能够拥有可想象到的各 ...

  4. Quartz Scheduler(2.2.1) - Working with TriggerListeners and JobListeners

    TriggerListeners and JobListeners Listeners are objects that you create to perform actions based on ...

  5. Nginx - HTTP Configuration, Module Variables

    The HTTP Core module introduces a large set of variables that you can use within the value of direct ...

  6. Linux C编程--打开和关闭流

    以下函数用于打开和关闭一个流.#include <stdio.h>FILE * fopen (const char *pathname, const char *opentype);int ...

  7. 方法:查询MongoDB数据库中最新一条数据(JAVA)

    使用JAVA语言查询MongoDB中某个数据库某个集合的最新一条数据: MongoCollection<Document> cpu = MongoClient.getDatabase(&q ...

  8. 3月3日(3) Binary Tree Preorder Traversal

    原题 Binary Tree Preorder Traversal 没什么好说的... 二叉树的前序遍历,当然如果我一样忘记了什么是前序遍历的..  啊啊.. 总之,前序.中序.后序,是按照根的位置来 ...

  9. zabbix3.0.3 设置邮件报警

    在zabbix3.0.3 设置报警这里卡了两天.终于解决了,这里我使用的mailx来作为发送邮件的客户端 1.设置mailx发信账号 yum -y install mailx ln -s /bin/m ...

  10. 《APUE》第七章笔记

    这一章主要是要解决这么几个问题: 当执行程序时,main函数是如何被调用的? main函数的原型是: int main(int argc, char *argv[]); 其中argc是命令个数,arg ...