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.