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

      0  

    Question Help or Bug: 'combo' not loading

    Help or Bug: 'combo' not loading


    Here's the configuration for my combo box:

    Code:
    {
          fieldLabel: 'Testing Combo',
          name: 'testing_combo',
          xtype: 'combo',
          mode: 'remote',
          autoLoad: true,
          typeAhead: true,
          store:
          {
            xtype: 'jsonstore',
            url: 'http://calendar.manchacaumc.org/dev2/api/get-contacts.pl',
            root: 'contacts',
            fields: [
              'id',
              'name'
            ],
            listeners: {
           //   load: function(records, options) {
           //     alert('loaded ' + records.totalLength + ' records');
           //   },
              loadexception: function(proxy, options, response, error) {
                alert('error loading records from server:');
              }
            }
          },
    
          listWidth: '300',
          hiddenName: 'testing_combo_name',
          triggerAction: 'all',
          valueField: 'id',
          displayField: 'name'
        }
    There are two thing about this. The first, is that if I use 'width' and not the 'anchor' with a percentage, then FireFox 3 renders the trigger to the left of the text field and you cannot trigger it.

    The second, and more important thing, is that upon trigger the drop-down just sits with
    "Loading..." and an endless spinner. Using FireBug I can see that the get-contacts.pl returns the following data (a single entry) as the entire contents of the body:

    {"contacts":[{"name":"John Doe","id":"332"}]}

    I'm not certain what content-type I should use for the get-contacts.pl, so I'm just returning text/plain.

    Thanks in advance!
    Last edited by mikedoug; 10 May 2009 at 12:44 PM. Reason: Fixed the code -- I left out fields!

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Being as you are using a full URI, I'm assuming you've hit the Same Origin Policy

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

      0  

    Question Same origin

    Same origin


    No, the same origin policy is not bothering me. As stated, using Firebug I can see the get-contacts.pl get called, and I my original post shows the data that Firebug reports as being sent from the server.

    I actually put the full URI in there early on in the debugging process and just haven't reverted it.

    Thanks in advance!!

    MikeDoug

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    95
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    1. width in percentage isn't supported (only numbers).
    2. The proper content-type would be application/json (but that isn't the problem here, because text/plain should also work).

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

      0  

    Post


    Looking back at what I wrote originally, I can see the confusion. What I meant was that if I did this:

    {
    ...
    width: 230
    ...
    }

    Then FF 3 on Vista renders as I described. I was not trying to use a percentage with the width. The only thing that makes it render consistently between FF and (at least) Chrome is using 'anchor' of '95%' (or any percentage).

    MikeDoug

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

      0  

    Question


    Also, I've done QUITE a bit of digging through the Ext code to see if I can pinpoint the problem, and what looks like is happening is that the 'datachanged' event on the store is not firing properly. Ext.data.Store.loadRecords() calls this.fireEvent("datachanged", this);, and then inside the EXTUTIL.Observable.prototype.fireEvent function, ce = true (instead of an object) -- and thus it fires no event. The following code shows how I found ce to be 'true':

    Code:
            fireEvent : function(){
                var a = TOARRAY(arguments),
                    ename = toLower(a[0]),
                    me = this,
                    ret = TRUE,
                    ce = me.events[ename],
                    q,
                    c;
                if (me.eventsSuspended === TRUE) {
                    if (q = me.suspendedEventsQueue) {
                        q.push(a);
                    }
                }
                else if(ISOBJECT(ce) && ce.bubble){
                    if(ce.fire.apply(ce, a.slice(1)) === FALSE) {
                        return FALSE;
                    }
                    c = me.getBubbleTarget && me.getBubbleTarget();
                    if(c && c.enableBubble) {
                        c.enableBubble(ename);
                        return c.fireEvent.apply(c, a);
                    }
                }
                else {
       if( ename == "datachanged" ) {  //MDMD
       alert(ce);
       }
                    if (ISOBJECT(ce)) {
                        a.shift();
                        ret = ce.fire.apply(ce, a);
                    }
                }
                return ret;
            },
    Since ce=true and is not an object, no events get called -- even though the dataView sets the eventhandler to this.refresh inside EXT.dataView.bindStore.

    The beforeload event fires properly, but not the datachanged event.

    Should this be fully classified as a bug now?

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

      0  

    Question


    It sounds like this thread http://www.extjs.com/forum/showthread.php?t=67569 may be similar to my problem. However, I'm not certain how to adapt my code to match their work around.

    Help!

    MikeDoug

Thread Participants: 2