怎么获取Editor每一行的控件了?比如combobox
解决方案 »
- javascript调用activeX控件函数成功后,能够返回函数里面的参数值供另外函数调用?
- ajax pro 2的使用问题
- 关于99宿舍里的Javascript代码
- js赋值struts标签事件问题
- Ajax如何加载其他页面内容
- 如何onload多个函数?
- 求教,怎样判断两个字符串在一个数组里面,我现在想问的是下面这个例子的判断条件为正确时,isCurrentUserInWriters 还是为false
- 请教:正则表达式中参数g对匹配结果的影响问题.
- 奇怪的下拉列表,innerHTML怎么不好用?
- 有些服务商提供CGI/ASP支持服务,没有说支持JAVA,如果网站中涉及到JAVA程序有问题吗?
- 求一个多选星期的控件
- 有关JS循环的问题?
cellclick: function(grid, rowIndex, columnIndex, e) {
var editor = grid.colModel.getCellEditor(columnIndex, rowIndex);
}
select:function(com){
var v = grid.getColumnModel.getCellEditor(colIndex,rowIndex);
v.field.store = new Ext.data.Store({});
}
像是这样的. 第选择一个都去入到入台.在后台输出都是对的.
但第二个combobox显示的还是一样
我一会把原码贴一下。大家帮我看看. 谢谢两位的关注啊..
var row;
var sm = new Ext.grid.CheckboxSelectionModel();
var sxlxStore = new Ext.data.JsonStore({
url:'../../bm23sxlxManager.do?method=dofindAll',
method:'post',
root:'data',
totalProperty:'results',
id:'scm',
fields:[{name:'scm',mapping:'scm',type:'int'},{name:'name',mapping:'name',type:'string'}]
});
var sxTypeStore = new Ext.data.JsonStore({
url:'../../bm23SxTypeManager.do?method=doGetSxName',
method:'post',
root:'data',
id:'sx_type_scm',
fields:[{name:'sx_type_scm',mapping:'scm',type:'int'},{name:'name',mapping:'name',type:'string'}]
});
sxlxStore.load();
var cm = [
new Ext.grid.RowNumberer(),sm,
{dataIndex:'scm',hidden:true},
{
header:'属性',dataIndex:'sxlx_scm',width:100,
editor:new Ext.grid.GridEditor(new Ext.form.ComboBox({
allowBlank:false,
store:sxlxStore,
mode:'local',
emptyText:'请选择',
valueField:'scm',
triggerAction : 'all',
displayField:'name',
listeners:{
select:function(com){
var v = sxGrid.getColumnModel().getCellEditor(5,row);
v.field.store = new Ext.data.JsonStore({
url:'../../bm23SxTypeManager.do?method=doGetSxName',
method:'post',
root:'data',
//totalProperty:'results',
id:'sx_type_scm',
fields:[{name:'sx_type_scm',mapping:'scm',type:'int'},{name:'name',mapping:'name',type:'string'}],
baseParams:{type:com.getValue()}
});
v.field.store.load();
}
}
})),
renderer:function(value){
var index = sxlxStore.find('scm',value);
if(index!=-1)
return sxlxStore.getAt(index).data.name;
return value;
}
},{
header:'科目号',dataIndex:'KMH',width:100,
editor:new Ext.grid.GridEditor(new Ext.form.TextField({
allowBlank:false
}))
},{
header:'名称',dataIndex:'name',width:100,
editor:new Ext.grid.GridEditor(new Ext.form.ComboBox({
allowBlank:false,
emptyText:'请选择',
valueField:'sx_type_scm',
triggerAction : 'all',
mode:'local',
displayField:'name',
store:sxTypeStore
}))
},{
header:'备注',dataIndex:'bz',width:100,
editor:new Ext.grid.GridEditor(new Ext.form.TextField({
allowBlank:false
}))
}
];
var myData=[['','','','','']]
var sxStore = new Ext.data.ArrayStore({
fields:[
{name:'scm'},
{name:'name'},
{name:'KMH'},
{name:'sxlx_scm'},
{name:'bz'}
]
});
var sxGrid = new Ext.grid.EditorGridPanel({
clicksToEdit: 1,
store:sxStore,
sm:sm,
cm:new Ext.grid.ColumnModel(cm),
listeners:{
rowmousedown:function(grid,rowIndex,e){
row=rowIndex;
}
},
viewConfig:{
forceFit:true
}
});
});
id:'common',
header: "Common Name",
dataIndex: 'common',
width: 220,
editor: new fm.TextField({
allowBlank: false
})
},{
header: "Light",
dataIndex: 'light',
width: 130,
editor: new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
transform:'light',
lazyRender:true,
listClass: 'x-combo-list-small',
listeners: {
select:function(com){
var v = grid.getColumnModel.getCellEditor(colIndex,rowIndex);
v.field.store = new Ext.data.Store({});
}//这样就为每个combox添加了事件了
}
})
}
var v = sxGrid.getColumnModel().getCellEditor(5,row);
v.field.store = new Ext.data.JsonStore({
url:'../../bm23SxTypeManager.do?method=doGetSxName',
method:'post',
root:'data',
//totalProperty:'results',
id:'sx_type_scm',
fields:[{name:'sx_type_scm',mapping:'scm',type:'int'},{name:'name',mapping:'name',type:'string'}],
baseParams:{type:com.getValue()}
});
v.field.store.load();这里得到了相应行的第二个combobox也进入后台了.测试输出数据也正确
可就是显示的一样.
var editor = grid.colModel.getCellEditor(columnIndex, rowIndex);
}