PDA

View Full Version : Getting components after load.



Cloetn
22 Feb 2011, 3:25 AM
Hi ,
Still learning EXTJS and I'm missing some basic logic here.
Currently people can view tickets , each tickets opens a new tab in the tabpanel. Each tab is a panel with 2 custom xtypes in it.

Everytime a new tab opens ( so after every load) I want to change one of my components in the panel.


afterRender:function(){
this.getForm().load({waitMsg:'Loading details of ticket.',
success:function(){
//I WANT TO DO CHANGES HERE???


}
});

Ext.ux.TicketDetail.superclass.afterRender.apply(this,arguments);

}

But I can't access the components with Ext.getCmp('itsid') because it will alter the other component in a previous tab.

Also: this.getComponent('itsid') , gives me the 'is not a function' error.


So basically to make things short:
I have several tabs with each a component that has the same ID.
How do I get the specific object in the tab I'm working with without getting the component from the other tab?


Grtz from a confused user.

drian
22 Feb 2011, 3:40 AM
You can't have multiple components with the same ID on the same page.

Try to use tabX.getComponent('someIdHere'), which searches inside tabX for a child component with the attribute itemId: 'someIdHere'... it should work.

Cloetn
22 Feb 2011, 4:22 AM
So everytime I make a new instance of my custom xtype I have to id all the components differently ?


But I still can't grab my components after the load.
My custom xtype is a extended formpanel btw.


afterRender:function(){
this.getForm().load({waitMsg:'Loading details of ticket.',
success:function(){

/////How do I get the properties of my form here???, this.getId() , this.getForm() etc doesnt work?!

}
});

Ext.ux.TicketDetail.superclass.afterRender.apply(this,arguments);

}