在子网格中选择行,选择具有相同行索引的父网格中的行 [英] Selecting row in child grid selects the row in parent grid with same row index
本文介绍了在子网格中选择行,选择具有相同行索引的父网格中的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经在Rowexpander Plugin中实现了嵌套网格。现在的问题是当我选择第n行子网格时,父网格第n行也被选中。我想,因为两者都有相同的rowIndex.Even当我的鼠标移动在子网格行同样的鼠标悬停效果显示为父也同时。
I have Implemented Nested Grid in Rowexpander Plugin.Now Issue is that when i am selecting any nth row of child grid then parent grid nth row also get selected . I think because both have same rowIndex.Even when i mouseover on the child grid row same mouseover effect display for parent also simultaneously.
下面是Rowexpander的代码
Below is the code for Rowexpander
var expander = new Ext.ux.grid.RowExpander({
expandOnDblClick : false,
tpl : new Ext.Template('<div id="NestedGridRow-{id}"></div>'),
renderer: function(v, p, record) {
if (record.get('cmaStatus') == 'G') {
p.cellAttr = 'rowspan="2"';
return '<div class="x-grid3-row-expander"></div>';
}
},
});
expander.on('expand', expandedRow);
function expandedRow(obj, record, body, rowIndex){
//absId parameter for the http request to get the absence details.
//Use Id to give each grid a unique identifier. The Id is used in the row expander tpl.
//and in the grid.render("ID") method.
var row = "NestedGridRow-" + record.get("id");
var id2 = "mygrid-" +record.get("id");
sapid_para = record.get('sapid');
//Create the nested grid.
var gridX = new Ext.grid.GridPanel({
id:'nestedGrid',
store: storenested,
//stripeRows: true,
columns: [
{
header : "CMA Date",
width : 120,
sortable : true,
dataIndex : 'cmaDate',
},
{
header : "Source Model",
width : 120,
sortable : true,
dataIndex : 'sourceModel',
},
{
header : "Remarks",
width : 390,
sortable : true,
dataIndex : 'remarks',
}],
height: 120,
id: id2,
plugins : [editor],
renderTo: row,
stripeRows:true,
listeners: {
render: function(gridX) {
gridX.getView().el.select('.x-grid3-header').setStyle('display', 'none');
},
rowclick : function(grid,rowIndex,e) {
alert(rowIndex);
}
},
});
gridX.render(row);
//Ext.getCmp('grid_lineage').getStore().load({params:{start:0, limit:10}});
storenested.load({params:{start:0, limit:10}});
请帮助
推荐答案
我有同样的问题。您将需要在嵌套网格上获取句柄,并调用此方法:
I had the same issue. You will need to get a handle on the nested grid, and call this:
gridX.getEl().swallowEvent(['mouseover', 'mousedown', 'click', 'dblclick', 'onRowFocus']);
这篇关于在子网格中选择行,选择具有相同行索引的父网格中的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文