X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/530ef4b6c5b943cfa68b779d11cf7de29aa878bf..6746dc89c47ed01b165cc1152533605f97eb8e8d:/examples/dd/dragdropzones.js diff --git a/examples/dd/dragdropzones.js b/examples/dd/dragdropzones.js index 8f0bb5a9..f320b7ce 100644 --- a/examples/dd/dragdropzones.js +++ b/examples/dd/dragdropzones.js @@ -1,9 +1,19 @@ -/*! - * Ext JS Library 3.2.1 - * Copyright(c) 2006-2010 Ext JS, Inc. - * 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 = [{ @@ -13,8 +23,8 @@ Ext.onReady(function() { telephone: '555 1234 123' }, { insuranceCode: '22222', - name: 'Fred West', - address: 'Cromwell Street', + name: 'Fred Bansod', + address: 'Van Ness', telephone: '666 666 666' }, { insuranceCode: '33333', @@ -33,19 +43,21 @@ Ext.onReady(function() { telephone: 'N/A' }]; - var PatientRecord = Ext.data.Record.create([{ - name: 'name' - }, { - name: 'address' - }, { - name: 'telephone' - }]); + Ext.define('Patient', { + extend: 'Ext.data.Model', + idProperty: 'insuranceCode', + fields: [{ + name: 'name' + }, { + name: 'address' + }, { + name: 'telephone' + }] + }); - var patientStore = new Ext.data.Store({ - data: patients, - reader: new Ext.data.JsonReader({ - id: 'insuranceCode' - }, PatientRecord) + var patientStore = Ext.create('Ext.data.Store', { + model: 'Patient', + data: patients }); var hospitals = [{ @@ -69,23 +81,25 @@ Ext.onReady(function() { address: 'Whitechapel, E1 1BB', telephone: '020 7377 7000' }]; - - var HospitalRecord = Ext.data.Record.create([{ - name: 'name' - }, { - name: 'address' - }, { - name: 'telephone' - }]); - var hospitalStore = new Ext.data.Store({ - data: hospitals, - reader: new Ext.data.JsonReader({ - id: 'code' - }, HospitalRecord) + 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 = new Ext.DataView({ + + var patientView = Ext.create('Ext.view.View', { cls: 'patient-view', tpl: '' + '
' + @@ -95,8 +109,8 @@ Ext.onReady(function() { '
' + '
', itemSelector: 'div.patient-source', - overClass: 'patient-over', - selectedClass: 'patient-selected', + overItemCls: 'patient-over', + selectedItemClass: 'patient-selected', singleSelect: true, store: patientStore, listeners: { @@ -104,17 +118,14 @@ Ext.onReady(function() { } }); - var helpWindow = new Ext.Window({ + var helpWindow = Ext.create('Ext.Window', { title: 'Source code', width: 920, height: 500, closeAction: 'hide', - bodyCfg: {tag: 'textarea', readonly: true}, - bodyStyle: { - backgroundColor: 'white', - margin: '0px', - border: '0px none' - }, + renderTpl: [ + '