Results 1 to 5 of 5

Thread: Adding Card to Kitchen Sink Disclosure List

  1. #1

    Default Adding Card to Kitchen Sink Disclosure List

    I am having real problems adding a new card to the Kitchen Sink example.

    I am using the ItemDisclosure List.

    Code:
    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?

  2. #2
    Sencha User
    Join Date
    Jul 2010
    Location
    Switzerland
    Posts
    78

    Default

    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

  3. #3

    Default

    Quote Originally Posted by fx-mike View Post
    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?

  4. #4
    Sencha User
    Join Date
    Jul 2010
    Location
    Switzerland
    Posts
    78

    Default

    I guess setActiveItem doesn't take config objects. Try this instead:

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

  5. #5

    Default

    Quote Originally Posted by fx-mike View Post
    I guess setActiveItem doesn't take config objects. Try this instead:

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

    Thank you so much.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •