-
11 May 2009 7:41 PM #1
[CLOSED] [3.0rc1.1] ComboBox/JsonStore bug
[CLOSED] [3.0rc1.1] ComboBox/JsonStore bug
You can refer to my thread in the help section -- but I will do a better job of laying out the problem in THIS thread.
This may or may not be fixed in the SVN tree, but since I don't have access to that I can neither confirm nor deny, and thus I am submitting this as a bug report.
Version: Ext JS Library 3.0 RC 1.1
Executive Overview:- I created a ComboBox with mode: remote and a JsonStore store.
- When clicking the trigger the dropdown appears with the spinner and the "Loading..." text.
- Using Firebug I can confirm that the remote data script was properly called, and returned the below quoted data.
- Tracing through the Ext JS code I've found that the Ext.data.Store.loadRecords() call to this.fireEvent("datachanged", this) fails to call the registered 'datachanged' function Ext.DataView.refresh(). (This is registered in Ext.DataView.bindStore())
- Inside the EXTUTIL.Observable.prototype.fireEvent call for 'datachanged' the 'ce' parameter is set to the boolean value of 'true' and NOT an object -- causing the ce.fire.apply(ce,a) call to be skipped.
The creation of my ComboBox:
I have two methods by which I've tried to create the ComboBox -- both exhibited the SAME behavior.
Method ONE:
Method TWO:Code:{ fieldLabel: 'Testing Combo', name: 'testing_combo', xtype: 'combo', mode: 'remote', autoLoad: true, typeAhead: true, store: { xtype: 'jsonstore', url: '/dev2/api/get-contacts.pl', root: 'contacts', fields: [ 'id', 'name' ], }, listWidth: '300', hiddenName: 'testing_combo_name', triggerAction: 'all', valueField: 'id', displayField: 'name' }
Here is the data returned by /dev2/api/get-contacts.pl:Code:{ fieldLabel: 'Testing Combo', name: 'testing_combo', xtype: 'combo', mode: 'remote', autoLoad: true, typeAhead: true, store: { xtype: 'store', url: '/dev2/api/get-contacts.pl', reader: new Ext.data.JsonReader({ root: 'contacts', fields: [ 'id', 'name' ], }) }, listWidth: '300', hiddenName: 'testing_combo_name', triggerAction: 'all', valueField: 'id', displayField: 'name' }
I posted this in the HELP forum first while I ran through the Ext code to figure it out, but I'm more comfortable with the fact that this is a bug now.Code:{ "contacts": [{ "name":"John Doe", "id":"332" }] }
Thanks,
MikeDougLast edited by mikedoug; 11 May 2009 at 7:43 PM. Reason: Put version in title
- I created a ComboBox with mode: remote and a JsonStore store.
-
11 May 2009 8:13 PM #2
Just to clarify, the bug is your data isn't being loaded? If so I can't replicate it, I'm using the following:
My data.asp page returnsCode:Ext.onReady(function(){ var fp = new Ext.form.FormPanel({ width: 400, height: 400, renderTo: document.body, items: { fieldLabel: 'Testing Combo', name: 'testing_combo', xtype: 'combo', mode: 'remote', autoLoad: true, typeAhead: true, store: { xtype: 'jsonstore', url: 'data.asp', root: 'contacts', fields: ['id', 'name'] }, listWidth: '300', hiddenName: 'testing_combo_name', triggerAction: 'all', valueField: 'id', displayField: 'name' } }); });
I'd suggest you add a loadexception listener to your store to make sure it's all working properly.Code:{ "contacts": [{ "name":"John Doe", "id":"332" }] }Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
11 May 2009 8:20 PM #3
Correct -- the data never loads -- it just sits there with the spinner with "Loading..."
I have done both a load and loadexception handlers -- and the load fires with a count of 1 record returned.
Are you doing your testing with the released version of 3.0rc1.1?
You can experience it here:
--URL removed--Last edited by mikedoug; 11 May 2009 at 10:06 PM. Reason: Removed URL for testing.
-
11 May 2009 8:23 PM #4
I'm using the latest SVN build. However I'm reasonably sure xtype support for stores in combos was added post RC1.1. Try your code using a pre-declared store instead of using an xtype.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
11 May 2009 8:39 PM #5
I've tried both ways. It creates the store object -- read my original post, it tells you EXACTLY where it breaks down with the firing of the event.
That said -- if you say it works with the new SVN code base, then that's great I'll just wait for the next rc release. Do you know when that would be? It could save on bug reports for fixed items.
Thanks,
MikeDoug
-
11 May 2009 9:36 PM #6
Once again, just to clarify, you've tried it with:
There was a bug in the combo that if you provided an xtype store it would end up creating 2 store objects, so the dataview would have a seperate store to the combo.Code:var store = new Ext.data.JsonStore(); var cmb = new Ext.form.ComboBox({ store: store });Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
11 May 2009 10:05 PM #7
Well, now that you put it that way -- apparently I hadn't tried that specific permutation. That fixed my problem. I'll comment my code to try the xtype method when you release the next RC or the final 3.0

Thanks for your assistance!
MikeDoug
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote