X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..3789b528d8dd8aad4558e38e22d775bcab1cbd36:/examples/dd/dragdropzones.js diff --git a/examples/dd/dragdropzones.js b/examples/dd/dragdropzones.js index 7167888e..4c87b4cc 100644 --- a/examples/dd/dragdropzones.js +++ b/examples/dd/dragdropzones.js @@ -1,285 +1,292 @@ -/*! - * Ext JS Library 3.1.1 - * Copyright(c) 2006-2010 Ext JS, LLC - * licensing@extjs.com - * http://www.extjs.com/license +Ext.require(['*']); + +Ext.onReady(function() { + + var patients = [{ + insuranceCode: '11111', + name: 'Fred Bloggs', + address: 'Main Street', + telephone: '555 1234 123' + }, { + insuranceCode: '22222', + name: 'Fred Bansod', + address: 'Van Ness', + telephone: '666 666 666' + }, { + insuranceCode: '33333', + name: 'Fred Mercury', + address: 'Over The Rainbow', + telephone: '555 321 0987' + }, { + insuranceCode: '44444', + name: 'Fred Forsyth', + address: 'Blimp Street', + telephone: '555 111 2222' + }, { + insuranceCode: '55555', + name: 'Fred Douglass', + address: 'Talbot County, Maryland', + telephone: 'N/A' + }]; + + Ext.define('Patient', { + extend: 'Ext.data.Model', + idProperty: 'insuranceCode', + fields: [{ + name: 'name' + }, { + name: 'address' + }, { + name: 'telephone' + }] + }); + + var patientStore = Ext.create('Ext.data.Store', { + model: 'Patient', + data: patients + }); + + var hospitals = [{ + code: 'AAAAA', + name: 'Saint Thomas', + address: 'Westminster Bridge Road, SE1 7EH', + telephone: '020 7188 7188' + }, { + code: 'BBBBB', + name: 'Queen\'s Medical Centre', + address: 'Derby Road, NG7 2UH', + telephone: '0115 924 9924' + }, { + code: 'CCCCC', + name: 'Saint Bartholomew', + address: 'West Smithfield, EC1A 7BE', + telephone: '020 7377 7000' + }, { + code: 'DDDDD', + name: 'Royal London', + address: 'Whitechapel, E1 1BB', + telephone: '020 7377 7000' + }]; + + Ext.define('Hospital', { + extend: 'Ext.data.Model', + idProperty: 'code', + fields: [{ + name: 'name' + }, { + name: 'address' + }, { + name: 'telephone' + }] + }); + + var hospitalStore = Ext.create('Ext.data.Store', { + model: 'Hospital', + data: hospitals + }); + + var patientView = Ext.create('Ext.view.View', { + cls: 'patient-view', + tpl: '' + + '
' + + '' + + '' + + '' + + '
Name{name}
Address{address}
Telephone{telephone}
' + + '
', + itemSelector: 'div.patient-source', + overItemCls: 'patient-over', + selectedItemClass: 'patient-selected', + singleSelect: true, + store: patientStore, + listeners: { + render: initializePatientDragZone + } + }); + + var helpWindow = Ext.create('Ext.Window', { + title: 'Source code', + width: 920, + height: 500, + closeAction: 'hide', + renderTpl: [ + '