-
11 Mar 2013 10:33 AM #1
Answered: Grouping Grid - Wrong row is get after itemdblclick event
Answered: Grouping Grid - Wrong row is get after itemdblclick event
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:
So how can I get data of clicked row in grouping grid? Is this a bug?Code:var groupingFeature = Ext.create('Ext.grid.feature.Grouping', { groupHeaderTpl: '{columnName}: {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})' }); this.features = [groupingFeature];"People will never forget how you made them feel."
linkedin.com/in/talhakabakus
-
Best Answer Posted by talha06
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.
-
11 Mar 2013 11:37 AM #2
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?
Code: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); } } });
-
11 Mar 2013 1:19 PM #3
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."People will never forget how you made them feel."
linkedin.com/in/talhakabakus


Reply With Quote