Alien-Web-ExtJS-V3
view release on metacpan or search on metacpan
share/examples/calendar/calendar-all-debug.js view on Meta::CPAN
displayField: 'desc',
valueField: 'value',
// private
initComponent: function() {
Ext.calendar.ReminderField.superclass.initComponent.call(this);
this.store = this.store || new Ext.data.ArrayStore({
fields: ['value', 'desc'],
idIndex: 0,
data: [
['', 'None'],
['0', 'At start time'],
['5', '5 minutes before start'],
['15', '15 minutes before start'],
['30', '30 minutes before start'],
['60', '1 hour before start'],
['90', '1.5 hours before start'],
['120', '2 hours before start'],
['180', '3 hours before start'],
['360', '6 hours before start'],
['720', '12 hours before start'],
['1440', '1 day before start'],
['2880', '2 days before start'],
['4320', '3 days before start'],
['5760', '4 days before start'],
['7200', '5 days before start'],
['10080', '1 week before start'],
['20160', '2 weeks before start']
]
});
},
// inherited docs
initValue: function() {
if (this.value !== undefined) {
this.setValue(this.value);
}
else {
this.setValue('');
}
this.originalValue = this.getValue();
}
});
Ext.reg('reminderfield', Ext.calendar.ReminderField);
/**
* @class Ext.calendar.EventEditForm
* @extends Ext.form.FormPanel
* <p>A custom form used for detailed editing of events.</p>
* <p>This is pretty much a standard form that is simply pre-configured for the options needed by the
* calendar components. It is also configured to automatically bind records of type {@link Ext.calendar.EventRecord}
* to and from the form.</p>
* <p>This form also provides custom events specific to the calendar so that other calendar components can be easily
* notified when an event has been edited via this component.</p>
* <p>The default configs are as follows:</p><pre><code>
labelWidth: 65,
title: 'Event Form',
titleTextAdd: 'Add Event',
titleTextEdit: 'Edit Event',
bodyStyle: 'background:transparent;padding:20px 20px 10px;',
border: false,
buttonAlign: 'center',
autoHeight: true,
cls: 'ext-evt-edit-form',
</code></pre>
* @constructor
* @param {Object} config The config object
*/
Ext.calendar.EventEditForm = Ext.extend(Ext.form.FormPanel, {
labelWidth: 65,
title: 'Event Form',
titleTextAdd: 'Add Event',
titleTextEdit: 'Edit Event',
bodyStyle: 'background:transparent;padding:20px 20px 10px;',
border: false,
buttonAlign: 'center',
autoHeight: true,
// to allow for the notes field to autogrow
cls: 'ext-evt-edit-form',
// private properties:
newId: 10000,
layout: 'column',
// private
initComponent: function() {
this.addEvents({
/**
* @event eventadd
* Fires after a new event is added
* @param {Ext.calendar.EventEditForm} this
* @param {Ext.calendar.EventRecord} rec The new {@link Ext.calendar.EventRecord record} that was added
*/
eventadd: true,
/**
* @event eventupdate
* Fires after an existing event is updated
* @param {Ext.calendar.EventEditForm} this
* @param {Ext.calendar.EventRecord} rec The new {@link Ext.calendar.EventRecord record} that was updated
*/
eventupdate: true,
/**
* @event eventdelete
* Fires after an event is deleted
* @param {Ext.calendar.EventEditForm} this
* @param {Ext.calendar.EventRecord} rec The new {@link Ext.calendar.EventRecord record} that was deleted
*/
eventdelete: true,
/**
* @event eventcancel
* Fires after an event add/edit operation is canceled by the user and no store update took place
* @param {Ext.calendar.EventEditForm} this
* @param {Ext.calendar.EventRecord} rec The new {@link Ext.calendar.EventRecord record} that was canceled
*/
eventcancel: true
});
this.titleField = new Ext.form.TextField({
fieldLabel: 'Title',
name: Ext.calendar.EventMappings.Title.name,
anchor: '90%'
});
this.dateRangeField = new Ext.calendar.DateRangeField({
fieldLabel: 'When',
anchor: '90%'
});
this.reminderField = new Ext.calendar.ReminderField({
name: 'Reminder'
});
this.notesField = new Ext.form.TextArea({
fieldLabel: 'Notes',
name: Ext.calendar.EventMappings.Notes.name,
grow: true,
share/examples/calendar/calendar-all-debug.js view on Meta::CPAN
this.form.updateRecord(this.activeRecord);
this.activeRecord.set(Ext.calendar.EventMappings.StartDate.name, dates[0]);
this.activeRecord.set(Ext.calendar.EventMappings.EndDate.name, dates[1]);
this.activeRecord.set(Ext.calendar.EventMappings.IsAllDay.name, dates[2]);
},
// private
onCancel: function() {
this.cleanup(true);
this.fireEvent('eventcancel', this, this.activeRecord);
},
// private
cleanup: function(hide) {
if (this.activeRecord && this.activeRecord.dirty) {
this.activeRecord.reject();
}
delete this.activeRecord;
if (this.form.isDirty()) {
this.form.reset();
}
},
// private
onSave: function() {
if (!this.form.isValid()) {
return;
}
this.updateRecord();
if (!this.activeRecord.dirty) {
this.onCancel();
return;
}
this.fireEvent(this.isAdd ? 'eventadd': 'eventupdate', this, this.activeRecord);
},
// private
onDelete: function() {
this.fireEvent('eventdelete', this, this.activeRecord);
}
});
Ext.reg('eventeditform', Ext.calendar.EventEditForm);
/**
* @class Ext.calendar.EventEditWindow
* @extends Ext.Window
* <p>A custom window containing a basic edit form used for quick editing of events.</p>
* <p>This window also provides custom events specific to the calendar so that other calendar components can be easily
* notified when an event has been edited via this component.</p>
* @constructor
* @param {Object} config The config object
*/
Ext.calendar.EventEditWindow = 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: 'Save',
disabled: false,
handler: this.onSave,
scope: this
},
{
id: 'delete-btn',
text: 'Delete',
disabled: false,
handler: this.onDelete,
scope: this,
hideMode: 'offsets'
( run in 0.783 second using v1.01-cache-2.11-cpan-9288abcf80b )