-
11 Sep 2012 9:07 AM #1
[4.1.1 GA] FiltersFeature automatic reconfiguring seems to be not impemented
[4.1.1 GA] FiltersFeature automatic reconfiguring seems to be not impemented
REQUIRED INFORMATION
Ext version tested:- Ext 4.1.1 GA
- There is the following phrase in the docs for FiltersFeature.
Automatic Reconfiguration:
Filters automatically reconfigure when the grid 'reconfigure' event fires.
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.ux.grid.FiltersFeature
- But, actually, I can't find anything in the FiltersFeature sources related to handling the grid's reconfigure event.
- In particular, a new store is not bound to the filters after calling .reconfigure(newStore). It is easy to bind calling the bindStore method of FiltersFeature, but I just pointing the problem out.
-
11 Sep 2012 10:06 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
Do you have a test case to show that they do not?
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.
-
11 Sep 2012 10:09 AM #3
Hi Mitchell,
Thank you for the response. Apologize, I will provide it soon, probably, tomorrow. Just going to sleep now
-
12 Sep 2012 7:04 AM #4
I prepared the following test case. Actually, it is a fake, but reproduces the problem.
Tested with Chrome.
- Steps
2. Try to filter. Please ignore "not found" error. The main thing is the fact that the "filter" parameter is sent with a request.
3. Click the Reconfigure Button.
4. Try to filter. There is no "filter" parameter in a request anymore.
- Test case
Code:<html> <head> <title>Filters reconfigure</title> <link type="text/css" rel="stylesheet" href="../resources/css/ext-all.css" /> <script type="text/javascript" src="../ext-all-debug.js"></script> <script type="text/javascript"> Ext.Loader.setConfig({enabled: true}); Ext.Loader.setPath('Ext.ux', '../examples/ux'); Ext.require([ 'Ext.grid.*', 'Ext.data.*', 'Ext.ux.grid.FiltersFeature' ]); var createStore = function () { return new Ext.data.Store({ autoLoad: false, fields: [{ name: "test" }], proxy: { type: "ajax", url: "test.htm" } }); }; Ext.onReady(function () { Ext.create("Ext.button.Button", { renderTo: Ext.getBody(), text: "Reconfigure", handler: function () { var newStore = createStore(); Ext.getCmp("GridPanel1").reconfigure(newStore); // The filters are sent if uncoment this line: //Ext.getCmp("GridPanel1").filters.bindStore(newStore); } }); Ext.create("Ext.grid.Panel", { id: "GridPanel1", renderTo: Ext.getBody(), store: createStore(), columns: { items: [{ dataIndex: "test", text: "Test" }] }, features: [Ext.create("Ext.ux.grid.FiltersFeature", { filters: [{ dataIndex: "test", type: "string" }] })] }); }); </script> </head> <body> </body> </html>- Screenshots
2. After reconfiguring.
- Solution
It fixes the problem.Code:Ext.getCmp("GridPanel1").filters.bindStore(newStore);
So, actually, it is not a big deal for me. I just pointed the problem out when red "automatic reconfiguring" in the docs, but, actually, not found any code in FiltersFeature related to reconfiguring. It is just an attempt to make ExtJS a bit better
-
18 Sep 2012 4:31 AM #5
Hi Mitchell,
Did you have a chance to look at the test case?
-
18 Sep 2012 5:14 AM #6Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
Yes, I have opened a bug in our bug tracker.
-
7 Dec 2012 8:25 AM #7
I have had the same problem. In the Ext.ux.grid.FiltersFeature class, add in the attachEvents method:
and add the onReconfigure to the same class:Code:attachEvents: function() { var me = this, view = me.view, headerCt = view.headerCt, grid = me.getGridPanel(), store = view.getStore(); me.bindStore(store, true); //<added> grid.on('reconfigure', me.onReconfigure, me); //</added> // Listen for header menu being created headerCt.on('menucreate', me.onMenuCreate, me); view.on('refresh', me.onRefresh, me); grid.on({ scope: me, beforestaterestore: me.applyState, beforestatesave: me.saveState, beforedestroy: me.destroy }); // Add event and filters shortcut on grid panel grid.filters = me; grid.addEvents('filterupdate'); },
Code:onReconfigure: function(grid, store){ //<debug> console.log('grid has been reconfigured, reBinding store..'); //</debug> this.bindStore(store, true); }
You found a bug! We've classified it as
EXTJSIV-7273
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote