PDA

View Full Version : index of Panel's Active item



irfaniqbal
5 Jan 2011, 4:09 AM
Hi,
is there any way i can find the index number of a Panel's Active Item. Any urgent help is my pleasure. thanks

Animal
5 Jan 2011, 4:33 AM
http://dev.sencha.com/deploy/touch/docs/?class=Ext.Container&member=items

http://dev.sencha.com/deploy/touch/docs/?class=Ext.util.MixedCollection&member=indexOf

irfaniqbal
5 Jan 2011, 8:34 AM
thanks Animal. i got you :)

erwin85
11 Apr 2011, 2:17 AM
I'm trying to do this also. I used the tutorial from PhoneGab. So my application is build in MVC.
I have a view with a listener:


listeners: {
'tap': function () {
Ext.dispatch({
controller: app.controllers.controller,
action: 'index',
id: 3,
animation: {type:'slide', direction:'right'}
});
}
}

Instead of the value 3 I like to have the current panel view where the listener is in. I tried to do this: id: this.findIndex, but that's not working.

In my controller I have the following code:


index: function(options) {

var id = parseInt(options.id);
app.views.viewport.setActiveItem(id);

}


Can someone help me with this?