Results 1 to 5 of 5

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

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Sep 2012
    Vote Rating

    Default 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:

        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'( for element.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts