1

i searched for my problem there is alot of questions and answers i found but none was useful to me
I have a xtype: 'component', in my panel i want to set dynamically htmlon panel show for it HERE is my component code

{
    xtype: 'component',
    itemId: 'dashboardwelcomenote',
    style: 'text-align: center'
},  

here is my controller

var welcomename = Ext.ComponentQuery.query('#dashboardwelcomenote')[0];
welcomename.setHtml('welcome');  

i want it on panel show any luck for me ?

Salman hassan
  • 398
  • 6
  • 23

2 Answers2

0

Instead of itemId you can use reference as follow:

{
        xtype: 'component',
        reference: 'dashboardwelcomenote',
        style: 'text-align: center'
}

Now on panel show or we can say init function of controller i.e page load, you can write:

this.lookupReference('dashboardwelcomenote').setHtml('welcome');

Here, "this" is the controller itself.

Hope this helps. Happy Learning :)

Harshit Shah
  • 266
  • 2
  • 7
0

Try update here is a fiddle.. Docs

Nikos Js
  • 199
  • 2
  • 10