mikedoug
11 May 2009, 7:41 PM
You can refer to my thread in the help section (http://www.extjs.com/forum/showthread.php?t=68083) -- 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:
{
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'
}
Method TWO:
{
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'
}
Here is the data returned by /dev2/api/get-contacts.pl:
{
"contacts": [{
"name":"John Doe",
"id":"332"
}]
}
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.
Thanks,
MikeDoug
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:
{
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'
}
Method TWO:
{
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'
}
Here is the data returned by /dev2/api/get-contacts.pl:
{
"contacts": [{
"name":"John Doe",
"id":"332"
}]
}
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.
Thanks,
MikeDoug