Threaded View

  1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    5
    Vote Rating
    0
    andrewchooah is on a distinguished road

      0  

    Default Answered: Appending HTML to existing HTML of a component ( + general efficiency questions)

    Answered: Appending HTML to existing HTML of a component ( + general efficiency questions)


    I want to append a value to an existing HTML string on a label. I can do this by reading the existing value, and then setting a new value based on the existing plus the new one, as follows:


    Code:
        onDebugPnlActivate: function(container, newActiveItem, oldActiveItem, options) {
            var ioconfig = ADPro.util.Config.getIo();
            var appid = container.down('#appid-label');
            var appsecret = container.down('#appsecret-label');
            var i = appid.getHtml();
            appid.setHtml(i + ioconfig.appId);
        }
    Is there a more efficient way to do this?

    I have a couple more questions regarding efficiency:

    The above example takes place in a Controller Action, where a Panel performs 'activate'. As you can see from the above, I'm acquiring the label element by querying the container.down - again, I wonder if this is an efficient means of both querying, and updating the value of an Element. I know there are many other ways to get a component, and other times during the lifecycle of the software to actually update the value of the component. In this case, I would be setting the value of the labels each time the component is activated - is that going to lead to more executions than necessary? I would like to establish the least-taxing method to make the app as responsive as possible.

    Many thanks for reading.

  2. Yes.Both Ext.get and Ext.getCmp create caches.
    btw,if you need 'appid-label' only once,use 'container.down'(Ext.ComponentQuery.query) for component,'element.down'(Ext.fly) for element.

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