PDA

View Full Version : Adding Card to Kitchen Sink Disclosure List



cherbert
26 Aug 2011, 4:53 AM
I am having real problems adding a new card to the Kitchen Sink example.

I am using the ItemDisclosure List.



onItemDisclosure: function(record, btn, index) {
sink.Main.ui.setCard({xtype:'panel',html:'test'},'slide');
},


Searching the forums people consistently state that .setCard is the method in which to add a card. However, I am getting Uncaught TypeError: Object [object Object] has no method 'setCard'

sink.Main.ui.SetActiveItem(0); works so I am obviously referencing an object with the layout of 'card' so why doesn't setCard?

If I am referencing the wrong object or referencing in the wrong way can someone guide me the correct way to link the onItemDisclosure event to open up a new card.

I have been tearing my hair out with this - please can anyone help?

fx-mike
26 Aug 2011, 5:22 AM
setCard has been deprecated for a while, setActiveItem is the way to go.
It might be noteworthy that setCard is still in the code referenced by the official docs, but it's not in 1.1 or even 1.01 anymore

cherbert
26 Aug 2011, 5:36 AM
setCard has been deprecated for a while, setActiveItem is the way to go.
It might be noteworthy that setCard is still in the code referenced by the official docs, but it's not in 1.1 or even 1.01 anymore

sink.Main.ui.setActiveItem({xtype:'panel',html:'test'},'slide');

Gives Uncaught TypeError: Object #<Object> has no method 'getItemId'

Is there another way to insert a new panel into sink.Main.ui and make it active?

fx-mike
26 Aug 2011, 5:50 AM
I guess setActiveItem doesn't take config objects. Try this instead:



sink.Main.ui.layout.setActiveItem(Ext.create({xtype:'panel',html:'test'}),'slide');

cherbert
1 Sep 2011, 3:40 AM
I guess setActiveItem doesn't take config objects. Try this instead:



sink.Main.ui.layout.setActiveItem(Ext.create({xtype:'panel',html:'test'}),'slide');


That worked!

Thank you so much.