Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext User
    Join Date
    May 2009
    Posts
    9
    Vote Rating
    0
    mikedoug is on a distinguished road

      0  

    Exclamation [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:
    1. I created a ComboBox with mode: remote and a JsonStore store.
    2. When clicking the trigger the dropdown appears with the spinner and the "Loading..." text.
    3. Using Firebug I can confirm that the remote data script was properly called, and returned the below quoted data.
    4. 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())
    5. 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:
    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'
        }
    Method TWO:
    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'
        }
    Here is the data returned by /dev2/api/get-contacts.pl:

    Code:
    {
      "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
    Last edited by mikedoug; 11 May 2009 at 7:43 PM. Reason: Put version in title

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,049
    Vote Rating
    657
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Just to clarify, the bug is your data isn't being loaded? If so I can't replicate it, I'm using the following:

    Code:
    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'
            }
        });
    });
    My data.asp page returns
    Code:
    {
      "contacts": [{
        "name":"John Doe",
        "id":"332"
      }]
    }
    I'd suggest you add a loadexception listener to your store to make sure it's all working properly.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Ext User
    Join Date
    May 2009
    Posts
    9
    Vote Rating
    0
    mikedoug is on a distinguished road

      0  

    Exclamation


    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.

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,049
    Vote Rating
    657
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    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!

  5. #5
    Ext User
    Join Date
    May 2009
    Posts
    9
    Vote Rating
    0
    mikedoug is on a distinguished road

      0  

    Default


    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

  6. #6
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,049
    Vote Rating
    657
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Once again, just to clarify, you've tried it with:

    Code:
    var store = new Ext.data.JsonStore();
    var cmb = new Ext.form.ComboBox({
        store: store
    });
    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.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  7. #7
    Ext User
    Join Date
    May 2009
    Posts
    9
    Vote Rating
    0
    mikedoug is on a distinguished road

      0  

    Smile


    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

Thread Participants: 1