Ataman
Ataman

Reputation: 2590

Passing variables to setActiveItem

How do i pass variables with Sencha Touch 2's setactiveitem function.

What I had was (which were working) instead of using setactiveitem i was using pop and push

var main = this.getMain();
    main.pop();
    main.push({
        xtype: 'carddetails',
        card: card,
        title: card.get('name'),
    });

But I switched to panel with layout card and as I activate the view I want to pass some variables:

main.setActiveItem('#carddetails',card); //something like this

How can i pass variables in this case?

Thanks!

Upvotes: 0

Views: 327

Answers (1)

Titouan de Bailleul
Titouan de Bailleul

Reputation: 12949

You can't, just create a function like updateViewWithData(data) where you update your view before showing it.

By the way, you weren't passing data to your push() function before, you were creating a view by passing a config object (which you don't do anymore with your setActiveItem()).

Upvotes: 1

Related Questions