Вот что у меня сработало:
var expandAllGroupsCheckbox = Ext.create(
{
xtype: 'checkbox',
boxLabel: 'Expand Groups by Default',
id: 'chkid',
checked: true,
afterRender: function() {
Ext.form.Checkbox.superclass.afterRender.call(this);
alert(this.getValue());// giving true
this.checkChanged();
},
checkChanged: function()
{
var checked = expandAllGroupsCheckbox.getValue();
gv.startCollapsed = !checked;
if ( gv.mainBody )
{
gv.toggleAllGroups( !checked );
}
},
listeners: {
check: {
fn: function(){expandAllGroupsCheckbox.checkChanged()}
}
}
});
А потом:
tbar: [
expandAllGroupsCheckbox
,
{
xtype: 'tbbutton',
icon: '/images/icon_list_props.gif',
handler: function() {
ShowPreferencesPage();
}
}
],