Upgrade to ExtJS 3.1.1 - Released 02/08/2010
[extjs.git] / examples / dd / dragdropzones.js
index e724b18..7167888 100644 (file)
@@ -1,11 +1,9 @@
-/*\r
- * Ext JS Library 2.2.1\r
- * Copyright(c) 2006-2009, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
+/*!
+ * Ext JS Library 3.1.1
+ * Copyright(c) 2006-2010 Ext JS, LLC
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
 Ext.onReady(function() {\r
 \r
     var patients = [{\r
@@ -17,7 +15,7 @@ Ext.onReady(function() {
         insuranceCode: '22222',\r
         name: 'Fred West',\r
         address: 'Cromwell Street',\r
-        telephone: '616 555 222'\r
+        telephone: '666 666 666'\r
     }, {\r
         insuranceCode: '33333',\r
         name: 'Fred Mercury',\r
@@ -97,6 +95,9 @@ Ext.onReady(function() {
                 '</tbody></table></div>' +\r
              '</tpl>',\r
         itemSelector: 'div.patient-source',\r
+        overClass: 'patient-over',\r
+        selectedClass: 'patient-selected',\r
+        singleSelect: true,\r
         store: patientStore,\r
         listeners: {\r
             render: initializePatientDragZone\r
@@ -150,7 +151,7 @@ Ext.onReady(function() {
             width: 100\r
         }],\r
         viewConfig: {\r
-            tpl: new Ext.XTemplate('<div class="hospital-target"></div>'),\r
+            tpl: new Ext.XTemplate('<div class="hospital-target">Drop Patient Here</div>'),\r
             enableRowBody: true,\r
             getRowClass: function(rec, idx, p, store) {\r
                 p.body = this.tpl.apply(rec.data);\r
@@ -167,7 +168,7 @@ Ext.onReady(function() {
         items: [{\r
             cls: 'app-header',\r
             region: 'north',\r
-            height: 100,\r
+            height: 30,\r
             html: '<h1>Patient Hospital Assignment</h1>',\r
             margins: '5 5 5 5'\r
         }, {\r
@@ -274,6 +275,8 @@ function initializeHospitalDropZone(g) {
         onNodeDrop : function(target, dd, e, data){\r
             var rowIndex = g.getView().findRowIndex(target);\r
             var h = g.getStore().getAt(rowIndex);\r
+            var targetEl = Ext.get(target);\r
+            targetEl.update(data.patientData.name+', '+targetEl.dom.innerHTML);\r
             Ext.Msg.alert('Drop gesture', 'Dropped patient ' + data.patientData.name +\r
                 ' on hospital ' + h.data.name);\r
             return true;\r