1. #1
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    95
    Vote Rating
    3
    grizzly21 is on a distinguished road

      0  

    Default Answered: Get html content of a panel

    Answered: Get html content of a panel


    Hi,

    I want to do a very simple thing:
    I have a panel that has a template, I call setData on it:

    Ext.getCmp("myPanel").setData( myData );

    Then how do I get the html that was rendered using the panels template?

    One way to do it is:
    Ext.getCmp("myPanel").getTpl().apply( myData )

    but obviously this is slow and unnecessary. I see a getHtml() method on the panel in the docs, but it returns null..

    thanks

  2. Hi,

    Code:
    var html = <your_panel>.getInnerHtmlElement().dom.innerHTML;
    PS: Please stay away from "Ext.getCmp()".

  3. #2
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Posts
    1,394
    Answers
    148
    Vote Rating
    22
    AndreaCammarata has a spectacular aura about AndreaCammarata has a spectacular aura about

      0  

    Default


    Hi,

    Code:
    var html = <your_panel>.getInnerHtmlElement().dom.innerHTML;
    PS: Please stay away from "Ext.getCmp()".
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    CEO at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    http://www.tux-components.com/


  4. #3
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    95
    Vote Rating
    3
    grizzly21 is on a distinguished road

      0  

    Default


    Thanks this worked.

    I could use itemId with mycontainer.down("#itemId").

    Or is there anything else I could do?

  5. #4
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Posts
    1,394
    Answers
    148
    Vote Rating
    22
    AndreaCammarata has a spectacular aura about AndreaCammarata has a spectacular aura about

      0  

    Default


    Quote Originally Posted by grizzly21 View Post
    Thanks this worked.

    I could use itemId with mycontainer.down("#itemId").

    Or is there anything else I could do?
    Yes, it's definitively better!
    Otherwise you could simply set a reference to your component directly inside the controller "refs" config.
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    CEO at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    http://www.tux-components.com/


  6. #5
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    95
    Vote Rating
    3
    grizzly21 is on a distinguished road

      0  

    Default


    ok, thanks.

Thread Participants: 1

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..."