Hybrid View

  1. #1
    Sencha User deepakgarg89's Avatar
    Join Date
    Nov 2012
    Location
    Gurgaon, India
    Posts
    43
    Answers
    4
    Vote Rating
    0
    deepakgarg89 is on a distinguished road

      0  

    Default Answered: Load dynamic html in view

    Answered: Load dynamic html in view


    Hi,

    I had make a view in sencha touch 2 app

    Ext.define("Myapp.view.Mynestedlist", {
    extend: 'Ext.Panel',
    xtype: 'mynestedlist',
    config: {
    html: [
    Hi nested list'
    ].join("")
    }
    });

    Here i want to load the html from my server through ajax. Can anyone please tell me a method how can i get dynamic html here.

  2. You can of course do this many different ways. Some questions can be asked to help find the best solution for you. When do you want the content to load? How often will the content change?

    I would generally recommend this be part of an MVC app. In the controller you could listen for an event such as activate on the panel then run the ajax request. In the callback you can use the panel's setHtml method to set the data. Alternately if you specify a template on the panel, you'd use the setData method.

    If this doesn't get you on your way, post more details about your app and what you want to accomplish.

    Brice

  3. #2
    bricemason's Avatar
    Join Date
    Jan 2008
    Location
    Upstate NY
    Posts
    280
    Answers
    49
    Vote Rating
    44
    bricemason has a spectacular aura about bricemason has a spectacular aura about bricemason has a spectacular aura about

      0  

    Default


    You can of course do this many different ways. Some questions can be asked to help find the best solution for you. When do you want the content to load? How often will the content change?

    I would generally recommend this be part of an MVC app. In the controller you could listen for an event such as activate on the panel then run the ajax request. In the callback you can use the panel's setHtml method to set the data. Alternately if you specify a template on the panel, you'd use the setData method.

    If this doesn't get you on your way, post more details about your app and what you want to accomplish.

    Brice
    Brice Mason
    Front End Developer
    Modus Create

    @bricemason
    bricemason.com

    Sencha Touch Screencasts
    Vimeo - Sencha Touch Channel

    Github Projects:
    Sencha Cordova Builder enables the automatic creation, building, and running of PhoneGap (Cordova) projects with Sencha Touch.

    Am I Sencha Touch Ready? checks your system to determine what you need to do to start Sencha Touch development. If you're having trouble getting up and running, try this out.

    Sencha Tools Bridge allows Sencha SDK Tools to co-exist with Sencha Cmd on the same system.

  4. #3
    Sencha User deepakgarg89's Avatar
    Join Date
    Nov 2012
    Location
    Gurgaon, India
    Posts
    43
    Answers
    4
    Vote Rating
    0
    deepakgarg89 is on a distinguished road

      0  

    Default Thanks for reply

    Thanks for reply


    I had follow your approach and than use view components. I had use initialize method and than push an ajax request. After getting response i use Ext.ComponentQuery.query('#listdata')[0].setHtml(response.responseText);

    listdata is my id in config html

Thread Participants: 1

Tags for this Thread

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