PDA

View Full Version : [CLOSED] CalendarPanel Toolbar button issue



speedstepmem4
Aug 14, 2014, 4:02 AM
Hi,

In Ext 1x version the below mentioned code in working fine regarding the Calendar Panel.



var calpanel = Ext.getCmp("CalendarPanel1");
var btnNewTask = new Ext.Toolbar.Button(
{
id: 'btnNewTask',
iconCls: 'icon-new-task',
tooltip: captions[newTaskToolTip]
}
);
btnNewTask.on('click', openNewTask, this);
calpanel.toolbars[0].insertButton(0, btnNewTask);



But we are facing some issues in the same code in Ext 2.5 version:

1) Ext.Toolbar.Button returns Toolbar is undefined.
2) calpanel.toolbars[0].insertButton(0, btnNewTask); returns undefined.


Please guide us to proceed further.

Daniil
Aug 14, 2014, 5:12 AM
Hi @speedstepmem4,


1) Ext.Toolbar.Button returns Toolbar is undefined.

Please use:

new Ext.button.Button(...)


2) calpanel.toolbars[0].insertButton(0, btnNewTask); returns undefined.
Not sure, but you probably need

calpanel.dockedItems.getAt(0)
instead of

calpanel.toolbars[0]