1. #1
    Sencha User
    Join Date
    Jan 2011
    Posts
    19
    Vote Rating
    0
    mjohnsonaz74 is on a distinguished road

      0  

    Default autoLoad callback

    autoLoad callback


    I apologize as I'm sure this question has been asked before, but a quick search of the forums did not yield the answer I was looking for. I have defined a simple panel that uses 'autoLoad' to import an html tree structure. I have some click events associated with the tree, but I can't assign them until after the panel has loaded its content.

    Code:
    var msa = {
            xtype: 'panel',
            anchor: '100%',
            autoLoad: "${createLink(controller: 'user', action: 'displayMsa')}",
            onLoad: alert("loaded2"),
            title: 'Panel inside a fieldset',
            frame: true,
            height: 100
          };
    In the above declaration I use some Grails code to dynamically create the link. What I'm trying to understand is: how do I assign an onLoad event to the autoLoad that's occuring? The above onLoad declaration fires off as soon as the panel is loaded into the DOM, but not when the panel content is loaded. Can somebody please point me to the proper way of assigning a callback that will trigger after 'autoLoad' has loaded its content? Thank you!

    MJ

  2. #2
    Sencha User darthwes's Avatar
    Join Date
    Mar 2010
    Posts
    633
    Vote Rating
    -13
    darthwes can only hope to improve

      0  

    Default


    Code:
    var msa = {
            xtype: 'panel',
            anchor: '100%',
            autoLoad: {
                url: "${createLink(controller: 'user', action: 'displayMsa')}",
                callback: function(el, succ, resp, opts) { alert("Loaded"); }
            },
            onLoad: alert("loaded2"),
            title: 'Panel inside a fieldset',
            frame: true,
            height: 100
          };
    Wes

  3. #3
    Sencha User
    Join Date
    Jan 2011
    Posts
    19
    Vote Rating
    0
    mjohnsonaz74 is on a distinguished road

      0  

    Default


    While I never feel dumb asking "dumb" questions, it never ceases to amaze me how simple some answers can be. Thank you so much for your quick response!

    MJ

  4. #4
    Sencha - Community Support Team VinylFox's Avatar
    Join Date
    Mar 2007
    Location
    Baltimore, MD
    Posts
    1,501
    Vote Rating
    7
    VinylFox will become famous soon enough VinylFox will become famous soon enough

      0  

    Default


    Just a side note...this line:
    Code:
    onLoad: alert("loaded2"),
    Is placing the result of the alert into onLoad, which is probably not what you wanted. Instead, you probably want onLoad to be a reference to the alert function.
    Code:
    onLoad: function(){ alert("loaded2") },

  5. #5
    Sencha User
    Join Date
    Jan 2011
    Posts
    19
    Vote Rating
    0
    mjohnsonaz74 is on a distinguished road

      0  

    Default


    Quote Originally Posted by VinylFox View Post
    Just a side note...this line:
    Code:
    onLoad: alert("loaded2"),
    Is placing the result of the alert into onLoad, which is probably not what you wanted. Instead, you probably want onLoad to be a reference to the alert function.
    Code:
    onLoad: function(){ alert("loaded2") },
    You are absolutely correct. I'm still new to Ext JS and I wasn't sure from the api how I was supposed to define the function. Although in hindsight it seems obvious, I was so turned around that even the obvious eluded me.

    MJ

Similar Threads

  1. Not sure how to use callback methods.
    By scoomey in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 23 Jul 2009, 5:37 AM
  2. callback not sent on load()
    By paubach in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 11 Apr 2008, 8:24 AM
  3. autoLoad callback / success handler
    By djfiii in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 8 Apr 2008, 8:25 AM

Thread Participants: 2

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar