X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6..3789b528d8dd8aad4558e38e22d775bcab1cbd36:/examples/dd/dragdropzones.js diff --git a/examples/dd/dragdropzones.js b/examples/dd/dragdropzones.js index 0541ee3e..4c87b4cc 100644 --- a/examples/dd/dragdropzones.js +++ b/examples/dd/dragdropzones.js @@ -1,9 +1,5 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ +Ext.require(['*']); + Ext.onReady(function() { var patients = [{ @@ -13,8 +9,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 +29,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 +67,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 +95,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 +104,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: [ + '