3 * Copyright(c) 2006-2010 Sencha Inc.
5 * http://www.sencha.com/license
8 * @class Ext.calendar.StatusProxy
9 * A specialized drag proxy that supports a drop status icon, {@link Ext.Layer} styles and auto-repair. It also
10 * contains a calendar-specific drag status message containing details about the dragged event's target drop date range.
11 * This is the default drag proxy used by all calendar views.
13 * @param {Object} config
15 Ext.calendar.StatusProxy = function(config) {
16 Ext.apply(this, config);
17 this.id = this.id || Ext.id();
18 this.el = new Ext.Layer({
21 cls: 'ext-dd-drag-proxy x-dd-drag-proxy ' + this.dropNotAllowed,
27 cls: 'ext-dd-ghost-ct',
30 cls: 'x-dd-drag-ghost'
39 shadow: !config || config.shadow !== false
41 this.ghost = Ext.get(this.el.dom.childNodes[1].childNodes[0]);
42 this.message = Ext.get(this.el.dom.childNodes[1].childNodes[1]);
43 this.dropStatus = this.dropNotAllowed;
46 Ext.extend(Ext.calendar.StatusProxy, Ext.dd.StatusProxy, {
48 * @cfg {String} moveEventCls
49 * The CSS class to apply to the status element when an event is being dragged (defaults to 'ext-cal-dd-move').
51 moveEventCls: 'ext-cal-dd-move',
53 * @cfg {String} addEventCls
54 * The CSS class to apply to the status element when drop is not allowed (defaults to 'ext-cal-dd-add').
56 addEventCls: 'ext-cal-dd-add',
59 update: function(html) {
60 if (typeof html == 'string') {
61 this.ghost.update(html);
63 this.ghost.update('');
64 html.style.margin = '0';
65 this.ghost.dom.appendChild(html);
67 var el = this.ghost.dom.firstChild;
69 Ext.fly(el).setStyle('float', 'none').setHeight('auto');
70 Ext.getDom(el).id += '-ddproxy';
75 * Update the calendar-specific drag status message without altering the ghost element.
76 * @param {String} msg The new status message
78 updateMsg: function(msg) {
79 this.message.update(msg);