Oct 18, 2013, 5:40 AM
[CLOSED] CalendarPanel: override EventEditWindow
Hi, I'm trying to override EventEditWindow in CalendarPanel to remove Save and Delete buttons. I'm doing this in the following way:
Ext.calendar.EventEditWindow.override({
constructor: function (config) {
var formPanelCfg = {
xtype: 'form',
labelWidth: 65,
frame: false,
bodyStyle: 'background:transparent;padding:5px 10px 10px;',
bodyBorder: false,
border: false,
items: [{
id: 'title',
name: Ext.calendar.EventMappings.Title.name,
fieldLabel: 'Title',
xtype: 'textfield',
anchor: '100%'
},
{
xtype: 'daterangefield',
id: 'date-range',
anchor: '100%',
fieldLabel: 'When'
}]
};
if (config.calendarStore) {
this.calendarStore = config.calendarStore;
delete config.calendarStore;
formPanelCfg.items.push({
xtype: 'calendarpicker',
id: 'calendar',
name: 'calendar',
anchor: '100%',
store: this.calendarStore
});
}
Ext.calendar.EventEditWindow.superclass.constructor.call(this, Ext.apply({
titleTextAdd: 'Add Event',
titleTextEdit: 'Edit Event',
width: 600,
autocreate: true,
border: true,
closeAction: 'hide',
modal: false,
resizable: false,
buttonAlign: 'left',
savingMessage: 'Saving changes...',
deletingMessage: 'Deleting event...',
fbar: [{
xtype: 'tbtext',
text: '<a href="#" id="tblink">Edit Details...</a>'
},
'->', {
text: 'Cancel',
disabled: false,
handler: this.onCancel,
scope: this
}],
items: formPanelCfg
},
config));
},
initComponent: function () {
Ext.calendar.EventEditWindow.superclass.initComponent.call(this);
this.formPanel = this.items.items[0];
this.addEvents({
/**
* @event eventcancel
* Fires after an event add/edit operation is canceled by the user and no store update took place
* @param {Ext.calendar.EventEditWindow} this
* @param {Ext.calendar.EventRecord} rec The new {@link Ext.calendar.EventRecord record} that was canceled
*/
eventcancel: true,
/**
* @event editdetails
* Fires when the user selects the option in this window to continue editing in the detailed edit form
* (by default, an instance of {@link Ext.calendar.EventEditForm}. Handling code should hide this window
* and transfer the current event record to the appropriate instance of the detailed form by showing it
* and calling {@link Ext.calendar.EventEditForm#loadRecord loadRecord}.
* @param {Ext.calendar.EventEditWindow} this
* @param {Ext.calendar.EventRecord} rec The {@link Ext.calendar.EventRecord record} that is currently being edited
*/
editdetails: true
});
}
And this does'n work. How to remove save and Delete buttons from the EventEditWindow?
Last edited by Baidaly; Oct 21, 2013 at 3:41 PM.
Reason: [CLOSED]