X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..6746dc89c47ed01b165cc1152533605f97eb8e8d:/examples/dd/dragdropzones.js diff --git a/examples/dd/dragdropzones.js b/examples/dd/dragdropzones.js index 80f1769e..f320b7ce 100644 --- a/examples/dd/dragdropzones.js +++ b/examples/dd/dragdropzones.js @@ -1,280 +1,307 @@ -/*! - * Ext JS Library 3.0.0 - * Copyright(c) 2006-2009 Ext JS, LLC - * licensing@extjs.com - * http://www.extjs.com/license +/* + +This file is part of Ext JS 4 + +Copyright (c) 2011 Sencha Inc + +Contact: http://www.sencha.com/contact + +GNU General Public License Usage +This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. + +If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact. + +*/ +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: [ + '