Roo/grid/Calendar.js
authorAlan Knowles <alan@roojs.com>
Thu, 10 Apr 2014 01:01:29 +0000 (09:01 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 10 Apr 2014 01:01:29 +0000 (09:01 +0800)
Roo/grid/Calendar.js

index d98440b..22ac495 100644 (file)
@@ -779,10 +779,58 @@ Roo.extend(Roo.grid.Calendar, Roo.grid.Grid, {
         
     },
     
+    
+    
+    
     renderEvents: function()
     {   
         // first make sure there is enough space..
         
+        if (!this.eventTmpl) {
+            this.eventTmpl = new Roo.Template(
+                '<div class="roo-dynamic fc-event fc-event-hori fc-event-draggable ui-draggable {cls}"  style="position: absolute" unselectable="on">' +
+                    '<div class="fc-event-inner">' +
+                        '<span class="fc-event-time">{time}</span>', +
+                        '<span class="fc-event-title" qtip="{qtip}">{title}</span>', +
+                    '</div>' +
+                    '<div class="ui-resizable-heandle ui-resizable-e">&nbsp;&nbsp;&nbsp;</div>' +
+                '</div>'
+            )
+                
+        }
+                var  cfg = {
+                    cls : 'roo-dynamic fc-event fc-event-hori fc-event-draggable ui-draggable',
+                    style : 'position: absolute', // left: 387px; width: 121px; top: 359px;
+                    
+                    unselectable : "on",
+                    cn : [
+                        {
+                            cls: 'fc-event-inner',
+                            cn : [
+                                {
+                                  tag:'span',
+                                  cls: 'fc-event-time',
+                                  html : cells.length > 1 ? '' : ev.start_dt.format('h:ia')
+                                },
+                                {
+                                  tag:'span',
+                                  cls: 'fc-event-title',
+                                  html : String.format('{0}', ev.title),
+                                  qtip: String.format('{0} - {1}', ev.title,ev.description || '')
+                                }
+                                
+                                
+                            ]
+                        },
+                        {
+                            cls: 'ui-resizable-handle ui-resizable-e',
+                            html : '&nbsp;&nbsp;&nbsp'
+                        }
+                        
+                    ]
+                };
+        
+        
         this.cells.each(function(c) {
             Roo.log(c.select('.fc-day-content div',true).first());
             c.select('.fc-day-content div',true).first().setHeight(Math.max(34, (c.rows || 1) * 20));