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,499
    Vote Rating
    46
    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,246
    Vote Rating
    87
    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


    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

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi