PDA

View Full Version : [CLOSED] activeItem isn't working with the splitButton..?



bu123
23 Jul 2010, 7:57 AM
Is this a known issue? Or am I just doing it wrong?

var mybuttons = [{
xtype: 'splitbutton',
centered: true,
layout: 'card',
activeItem: 1,
floating: true,
items: [{
text: 'Today',
minWidth: '75',
handler: tapHandler
}, {
minWidth: '75',
text: 'This Week',
handler: tapHandler
}, {
minWidth: '75',
text: 'All',
handler: tapHandler
}]
}];

meyerovb
23 Jul 2010, 10:20 AM
activeItem is for card layouts and is not yet implemented for splitbuttons. Here is the code example from within the splitbutton implementation. Hopefully the future documentation cleanup will give more details to this component, and expose the example (as it's not visible on the api web page, you have to click into the actual file to see it).



var splitBtn = new Ext.SplitButton({
allowMultiple: true,
items: [{
text: 'Option 1',
active: true,
handler: tapMe
},{
text: 'Option 2',
active: true,
handler: tapMe
},{
text: 'Option 3',
handler: tapMe
}]
});

bu123
23 Jul 2010, 10:41 AM
active: true will work for me. Thanks!

Jamie Avins
30 Jul 2010, 10:54 AM
The card layout was updated recently and we should be updating the documentation as well.

meyerovb
30 Jul 2010, 10:58 AM
Jamie, just a note, this is a documentation issue in the SplitButton, not the card layout.

notcourage
28 Jun 2011, 12:47 PM
So how should the first focus of a form be set?