PDA

View Full Version : Grouping Grid - Wrong row is get after itemdblclick event



talha06
11 Mar 2013, 10:33 AM
Hi everyone,

I'm getting wrong row after itemdblclick event using grouping grid with 4.1.1.a version.

Here's my grouping feature definition:


var groupingFeature = Ext.create('Ext.grid.feature.Grouping', {
groupHeaderTpl: '{columnName}: {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})'
});


this.features = [groupingFeature];


So how can I get data of clicked row in grouping grid? Is this a bug?

slemmon
11 Mar 2013, 11:37 AM
The following was working for me in 4.1.1 and 4.1.3.
Want to see if it works for you or if fails as well?



var store = Ext.create('Ext.data.Store', {
storeId:'employeeStore',
fields:['name', 'seniority', 'department'],
groupField: 'department',
data: {'employees':[
{ "name": "Michael Scott", "seniority": 7, "department": "Management" },
{ "name": "Dwight Schrute", "seniority": 2, "department": "Sales" },
{ "name": "Jim Halpert", "seniority": 3, "department": "Sales" },
{ "name": "Kevin Malone", "seniority": 4, "department": "Accounting" },
{ "name": "Angela Martin", "seniority": 5, "department": "Accounting" }
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'employees'
}
}
});


Ext.create('Ext.grid.Panel', {
title: 'Employees',
store: Ext.data.StoreManager.lookup('employeeStore'),
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Seniority', dataIndex: 'seniority' }
],
features: [{ftype:'grouping'}],
width: 200,
height: 275,
renderTo: Ext.getBody()
, listeners: {
itemdblclick: function (view, record, row, i, e) {
// console.log(record.get('name'))
//console.log(i);
console.log(row);
}
}
});

talha06
11 Mar 2013, 1:19 PM
I found the problem; the difference is that I'm using ajax proxy and when I trigger itemdblclick event, I get records in the exact order at server-side. Grouping field feature just changes the display of data; store is still same. To change this remoteSort config of store must be false! FYI.

Thanks for your interest & care to my question.