PDA

View Full Version : Row Expander Click event selects wrong row.



shriniv78
9 Apr 2011, 7:51 AM
I wanted to use the row expander and was facing a weird issue. Also, I might by trying to use it in a manner it might not be built for. In the body element of the expander, I am rendering another grid panel to display different data. After the new grid renders in the body, if I click a row, it triggers events in the parent grid selecting wrong row. select parent grid's row based on the same index of the sub grid.



Statistics = Ext.extend(Ext.ux.grid.RowExpander, {
expandOnDblClick: false,
listeners: {
expand: {
fn: function(expander, record, bodyEl, rowIndex) {
if (bodyEl.innerHTML == '') {
new Ext.grid.GridPanel({

expanderGrid: expander.grid,
store: new Ext.data.JsonStore({
root: 'rows',
totalProperty: 'total',
idProperty: 'ordering',
autoLoad: true,
fields: ['ordering', 'status', 'count1', 'count2', 'count3', 'count4', 'count5', 'count6', 'count7'],
url: statUrl,
baseParams: {
action: 'GETSTATISTICS',
isNamed: 'true',
constituentId: record.id
}
}),
border: false,
autoHeight: true,
autoWidth: true,
renderTo: bodyEl,
trackMouseOver: false,
disableSelection: true,
enableColumnMove: false,
enableColumnResize: false,
loadMask: true,
frame: true,
columns: [
{ dataIndex: 'status', header: "Status", sortable: false },
{ dataIndex: 'count1', header: "count1", sortable: false },
{ dataIndex: 'count2', header: "count2", sortable: false },
{ dataIndex: 'count3', header: "count3", sortable: false },
{ dataIndex: 'count4', header: "count4", sortable: false },
{ dataIndex: 'count5', header: "count5", sortable: false },
{ dataIndex: 'count6', header: "count6", sortable: false },
{ dataIndex: 'count7', header: "count7", sortable: false }
]
});
}
}
}
}
});


Thanks much for any advice.
Shrini Viswanathan