-
7 Apr 2009 9:08 AM #1
[FIXED] [3.0] My store changed from an object variable to a class variable!!!
[FIXED] [3.0] My store changed from an object variable to a class variable!!!
Hello friends!
So I again updated to the latest svn and now I am having issues with my stores being shared throughout all of my grids. Again, this is very likely to be my bug, uncovered by the slightly different environment of Ext 3..
Here is a Working Showcase :-)
Note that the url is the same for both, yet it should be different.Code:<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Aircraft Ducting Repair, Inc.</title> <script type="text/javascript" src="js/lib/ext3/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="js/lib/ext3/ext-all-debug.js"></script> <link rel="stylesheet" type="text/css" href="js/lib/ext3/resources/css/ext-all.css" /> <script type="text/javascript"> Ext.ns('ACDRI.ui'); ACDRI.ui.Grid = Ext.extend(Ext.grid.GridPanel, { onRender: function(ct, position) { ACDRI.ui.Grid.superclass.onRender.call(this, ct, position); this.getStore().load(); }, initComponent: function() { this.baseParams = this.baseParams || {}; var storeCfg = { proxy: new Ext.data.HttpProxy({ url: this.url }), reader: new Ext.data.JsonReader({ root: 'data', totalProperty: 'total' }, this.record), remoteSort: true, baseParams: this.baseParams }; if (this.sortInfo) { Ext.apply(storeCfg, {sortInfo: this.sortInfo}); } var store = new Ext.data.Store(storeCfg); var sm = new Ext.grid.CheckboxSelectionModel(); var config = { store: store, loadMask: true, sm: sm, baseParams: this.baseParams }; Ext.apply(this, Ext.apply(this.initialConfig, config )); ACDRI.ui.Grid.superclass.initComponent.apply(this, arguments); } }); </script> <script type="text/javascript"> ACDRI.ui.WorkOrders = Ext.extend(ACDRI.ui.Grid, { initComponent: function() { this.url = 'bar'; this.sortInfo = { field: 'repair_order_date_received', direction: 'desc' }; this.record = Ext.data.Record.create([ {name: 'id', type: 'string'} ]); var config = { title: 'Work Orders', columns: [{ header: 'ID', tooltip: 'ID used to identify the Work Order', dataIndex: 'id', hidden: true }]}; Ext.apply(this, Ext.apply(this.initialConfig, config )); ACDRI.ui.WorkOrders.superclass.initComponent.apply(this, arguments); } }); Ext.reg('workorders', ACDRI.ui.WorkOrders); </script> <script type="text/javascript"> ACDRI.ui.MoreDifferentWorkOrders = Ext.extend(ACDRI.ui.Grid, { initComponent: function() { this.sortInfo = { field: 'repair_order_date_received', direction: 'desc' }; this.url = 'foo'; this.record = Ext.data.Record.create([ {name: 'id', type: 'string'} ]); var config = { title: 'Work Orders', columns: [{ header: 'ID', tooltip: 'ID used to identify the Work Order', dataIndex: 'id', hidden: true }]}; Ext.apply(this, Ext.apply(this.initialConfig, config )); ACDRI.ui.MoreDifferentWorkOrders.superclass.initComponent.apply(this, arguments); } }); Ext.reg('mdworkorders', ACDRI.ui.MoreDifferentWorkOrders); </script> <script type="text/javascript"> Ext.onReady(function() { new Ext.Window({ items: { xtype: 'workorders', height: 400, width: 400 }}).show(); new Ext.Window({ items: { xtype: 'mdworkorders', height: 400, width: 400 }}).show(); }); </script> </head> <body> <div id='main'></div> </body> </html>
Thanks for any input at all!-fREW
-
7 Apr 2009 9:52 AM #2
What should we watch when running it? How we see that problem?
Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video
-
7 Apr 2009 9:53 AM #3
Just a little bit more (slightly disconcerting) information: this isn't just my grids, but all of the stores in my whole program. (eg AutoCompleters)
So yeah, I just have a store that is accessed by an accidental singleton...-fREW
-
7 Apr 2009 9:54 AM #4
-
7 Apr 2009 10:39 AM #5
It really seems to be a bug, I suspect that new store execute method. My showcase follows. I've added console.log that outputs proxy url. This console output is correct (bar and foo) but both requests are sent to bar url which is wrong. Moving this thread to bugs:
HTML Code:<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Aircraft Ducting Repair, Inc.</title> <script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="ext/ext-all-debug.js"></script> <link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css" /> <script type="text/javascript"> Ext.ns('ACDRI.ui'); ACDRI.ui.Grid = Ext.extend(Ext.grid.GridPanel, { onRender: function(ct, position) { ACDRI.ui.Grid.superclass.onRender.call(this, ct, position); var url = this.store.proxy.url; console.log(url); this.getStore().load(); }, initComponent: function() { this.baseParams = this.baseParams || {}; var storeCfg = { proxy: new Ext.data.HttpProxy({ url: this.url }), reader: new Ext.data.JsonReader({ root: 'data', totalProperty: 'total' }, this.record), remoteSort: true, baseParams: this.baseParams }; if (this.sortInfo) { Ext.apply(storeCfg, {sortInfo: this.sortInfo}); } var store = new Ext.data.Store(storeCfg); var sm = new Ext.grid.CheckboxSelectionModel(); var config = { store: store, loadMask: true, sm: sm, baseParams: this.baseParams }; Ext.apply(this, Ext.apply(this.initialConfig, config )); ACDRI.ui.Grid.superclass.initComponent.apply(this, arguments); } }); </script> <script type="text/javascript"> ACDRI.ui.WorkOrders = Ext.extend(ACDRI.ui.Grid, { initComponent: function() { this.url = 'bar'; this.sortInfo = { field: 'repair_order_date_received', direction: 'desc' }; this.record = Ext.data.Record.create([ {name: 'id', type: 'string'} ]); var config = { title: 'Work Orders', columns: [{ header: 'ID', tooltip: 'ID used to identify the Work Order', dataIndex: 'id', hidden: true }]}; Ext.apply(this, Ext.apply(this.initialConfig, config )); ACDRI.ui.WorkOrders.superclass.initComponent.apply(this, arguments); } }); Ext.reg('workorders', ACDRI.ui.WorkOrders); </script> <script type="text/javascript"> ACDRI.ui.MoreDifferentWorkOrders = Ext.extend(ACDRI.ui.Grid, { initComponent: function() { this.sortInfo = { field: 'repair_order_date_received', direction: 'desc' }; this.url = 'foo'; this.record = Ext.data.Record.create([ {name: 'id', type: 'string'} ]); var config = { title: 'Work Orders', columns: [{ header: 'ID', tooltip: 'ID used to identify the Work Order', dataIndex: 'id', hidden: true }]}; Ext.apply(this, Ext.apply(this.initialConfig, config )); ACDRI.ui.MoreDifferentWorkOrders.superclass.initComponent.apply(this, arguments); } }); Ext.reg('mdworkorders', ACDRI.ui.MoreDifferentWorkOrders); </script> <script type="text/javascript"> Ext.onReady(function() { new Ext.Window({ items: { xtype: 'workorders', height: 400, width: 400 }}).show(); new Ext.Window({ items: { xtype: 'mdworkorders', height: 400, width: 400 }}).show(); }); </script> </head> <body> <div id='main'></div> </body> </html>
Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video
-
8 Apr 2009 7:17 AM #6
Hello,
I have the same problem after updating to the latest svn.
Now my first grid shows fine, but all following grids load from the first URL.
Greetings,
Stefan
-
8 Apr 2009 7:23 AM #7
>The issue is due to changes in the Ext.data.DataProxy where a complex object 'api' is stored in the prototype.
Aaron was right. Fixed.
Sorry guys.
Fixed.Aaron Conran
@aconran
Sencha Architect Development Team
-
9 Apr 2009 10:17 AM #8
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote

