Ext.namespace( 'instore.extlib.ui.form.plugin' ); instore.extlib.ui.form.plugin.addHTMLLabels = function(config) { config = config || []; this.configArr = Ext.isArray(config) ? config : [config]; } instore.extlib.ui.form.plugin.addHTMLLabels.prototype.init = function(form) { var topLabels = []; var bottomLabels = []; Ext.each(this.configArr, function(config) { if(config.position) { var label = new Ext.form.Label(config); switch(config.position) { case "top": topLabels.push(label); break; case "bottom": bottomLabels.push(label); break; } } }); form.items.items = topLabels.concat(form.items.items, bottomLabels); };