1. #1
    Ext User
    Join Date
    Jul 2008
    Posts
    11
    Vote Rating
    0
    rameshc is on a distinguished road

      0  

    Default Exttracting headings from html that came from a url

    Exttracting headings from html that came from a url


    I have a 2 column layout where the right column is a 2-level tab panel. When I click on a second level tab, html from a url gets loaded into that panel. What I want to do is in the 'render' event callback for that panel, I want to be able to extract all the heading1 headings from the loaded html and show that as an index in the left column. What I have tried so far is to given below, but it isn't working. Any ideas on what I should be doing here?

    Code:
     function panelRenderHandler(p) {
      var h1list = p.getEl().select('h1', true);
     
      var i = h1list.getCount();
     
      //if I know the count, maybe I can proceed further and add some code here
      //to build the table of contents
     }
    When I run this this snippet along with the rest of my code, h1list.getCount seems to be unhappy.

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

      0  

    Default


    Have you debugged?

  3. #3
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    Are you using autoLoad to load the content into the panel? In that case you need to use the autoLoad callback instead of the render event (fired to soon):

    Code:
    autoLoad: {
      url: '...',
      callback: function(el, success) {
        if (success) {
          var h1list = el.select('h1', true);
          ...
        }
      }
    }

  4. #4
    Ext User
    Join Date
    Jul 2008
    Posts
    11
    Vote Rating
    0
    rameshc is on a distinguished road

      0  

    Default Thanks, that worked!

    Thanks, that worked!


    The render callback was firing too early. Having a callback for the autoLoad did it.

Thread Participants: 2

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