-
5 Dec 2012 9:26 AM #1
[4.1.3] Grouping feature initially disabled but store is still grouped
[4.1.3] Grouping feature initially disabled but store is still grouped
REQUIRED INFORMATION
Ext version tested:- Ext 4.1.3
- Chrome 23
- If the grouping feature is initially configured as 'disabled:true' but the store is defined with a groupField, then the checked state of the grouping menu item is inconsistent with the store.
- Run the code.
- Examine the query parameters for the "sheldon.xml" request. Both a "group" and "sort" param are being sent.
- Examine the state of the "Show in groups" checkbox in the column header menu.
- Click the "Show in groups" checkbox twice so that it is the same checked state.
- Run this code: Code:
Ext.ComponentQuery.query('gridpanel')[0].getStore().load() - Examine the query parameters of the second "sheldon.xml" request. The params "group" and "sort" were not specified.
The result that was expected:- If the grouping feature is initially configured, the store data should not be grouped.
- The data is initially grouped.
I modified the code in xml-grid.js as follows:
Code:
Code:Ext.require([ 'Ext.data.*', 'Ext.grid.*' ]); Ext.onReady(function(){ Ext.define('Book',{ extend: 'Ext.data.Model', proxy: { type: 'ajax', reader: 'xml' }, fields: [ // set up the fields mapping into the xml doc // The first needs mapping, the others are very basic {name: 'Author', mapping: '@author.name'}, 'Title', 'Manufacturer', 'ProductGroup' ] }); // create the Data Store var store = Ext.create('Ext.data.Store', { model: 'Book', autoLoad: true, groupField: 'Author', //<--- NEW proxy: { // load using HTTP type: 'ajax', url: 'sheldon.xml', // the return will be XML, so lets set up a reader reader: { type: 'xml', // records will have an "Item" tag record: 'Item', idProperty: 'ASIN', totalRecords: '@total' } } }); // create the grid Ext.create('Ext.grid.Panel', { store: store, columns: [ {text: "Author", flex: 1, dataIndex: 'Author'}, {text: "Title", width: 180, dataIndex: 'Title'}, {text: "Manufacturer", width: 115, dataIndex: 'Manufacturer'}, {text: "Product Group", width: 100, dataIndex: 'ProductGroup'} ], renderTo:'example-grid', width: 540, height: 200, features: [{ //<--- NEW disabled: true, ftype: 'grouping' }] }); });
HELPFUL INFORMATION
Debugging already done:- none
- none
- only default ext-all.css
- Win 7
-
5 Dec 2012 12:08 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
This is done intentional when you have groupField set on the store:
Code:if (!groupers && groupField) { groupers = [{ property : groupField, direction: config.groupDir || me.groupDir }]; }Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
5 Dec 2012 12:13 PM #3
@mitchellsimoens
Ok - can the docs be updated to indicate this or a console warning be added since the UI does not indicate that grouping is actually in effect?
You found a bug! We've classified it as
EXTJSIV-7990
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote