64
RIA - Entwicklung mit Ext JS @muhdiekuh / @djungowski Hans-Christian Otto / crosscan GmbH Dominik Jungowski / CHIP Xonio Online GmbH

RIA - Entwicklung mit Ext JS

Embed Size (px)

DESCRIPTION

Slides für den Ganztages-Workshop "RIA - Entwicklung mit Ext JS" auf der International PHP Conference 2011

Citation preview

Page 1: RIA - Entwicklung mit Ext JS

RIA - Entwicklung mit Ext JS@muhdiekuh / @djungowski

Hans-Christian Otto / crosscan GmbHDominik Jungowski / CHIP Xonio Online GmbH

Page 2: RIA - Entwicklung mit Ext JS

Dominik Jungowski

27 Jahre alt

Teamleiter und ScrumMaster bei CHIP Online

Student der Psychologie an der Fernuni Hagen

Ext JS Entwickler seit 3 Jahren

Page 3: RIA - Entwicklung mit Ext JS

Hans-Christian Otto

22 Jahre alt

Leiter der Software-Entwicklung bei der crosscan GmbH

Student der Informatik an der TU Dortmund

Ext JS Entwickler seit 4 Jahren

Page 4: RIA - Entwicklung mit Ext JS

Über Ext JS

Page 5: RIA - Entwicklung mit Ext JS

Agenda

Warm laufen

Grundlagen

Vertiefung

Anwendung

Page 6: RIA - Entwicklung mit Ext JS

http://bit.ly/iZJWnw

Page 7: RIA - Entwicklung mit Ext JS

Was möglich ist

Page 8: RIA - Entwicklung mit Ext JS

ext.js vs. ext-all.js

Page 9: RIA - Entwicklung mit Ext JS

Ext.data.proxy.Server

src/data/proxy/Server.js

Page 10: RIA - Entwicklung mit Ext JS

Ext.onReady(function() { var viewport; viewport = Ext.create( 'Ext.container.Viewport', { html: 'Ext JS is awwwesome!' } );});

Page 11: RIA - Entwicklung mit Ext JS
Page 12: RIA - Entwicklung mit Ext JS

viewport = Ext.create( 'Ext.container.Viewport', { layout: 'border', items: [ panel ] });

Page 13: RIA - Entwicklung mit Ext JS

panel = Ext.create( 'Ext.Panel', { title: 'Harzer Grauhof', region: 'center' });

Page 14: RIA - Entwicklung mit Ext JS

Border Layout

Page 15: RIA - Entwicklung mit Ext JS
Page 16: RIA - Entwicklung mit Ext JS
Page 17: RIA - Entwicklung mit Ext JS
Page 18: RIA - Entwicklung mit Ext JS
Page 19: RIA - Entwicklung mit Ext JS

Stores

Page 20: RIA - Entwicklung mit Ext JS

Source: Ext JS Api Docs

Page 21: RIA - Entwicklung mit Ext JS

Source: Ext JS Api Docs

Page 22: RIA - Entwicklung mit Ext JS

store = Ext.create( 'Ext.data.Store', id: 'IPC.store.GridPanel', { fields: ['name', 'email'], data: [ {name: 'Ed', email: '[email protected]'}, {name: 'Tommy', email: '[email protected]'} ] });

Page 23: RIA - Entwicklung mit Ext JS

gridPanel = Ext.create( 'Ext.grid.Panel', { title : 'All Users', region: 'west', width: 200, loadMask: true, store: 'IPC.store.GridPanel', columns: [ {header: 'Name', dataIndex: 'name'}, {header: 'Email', dataIndex: 'email'} ] });

Page 24: RIA - Entwicklung mit Ext JS

gridPanel = Ext.create( 'Ext.grid.Panel', { title : 'All Users', region: 'west', width: 200, loadMask: true, store: 'IPC.store.GridPanel', columns: [ {header: 'Name', dataIndex: 'name'}, {header: 'Email', dataIndex: 'email'} ] });

Page 25: RIA - Entwicklung mit Ext JS
Page 26: RIA - Entwicklung mit Ext JS

Ext.grid.Panel

Dummydaten: IPC.DummydataFields: first, last, age, city

Page 27: RIA - Entwicklung mit Ext JS

Vererbung

Page 28: RIA - Entwicklung mit Ext JS

Ext.define('IPC.grid.Panel', { extend: 'Ext.grid.Panel', title : 'All Users', region: 'west', width: 200, loadMask: true, initComponent: function() { this.store = 'IPC.store.GridPanel'; this.columns = [ {header: 'Name', dataIndex: 'name'}, {header: 'Email', dataIndex: 'email'} ]; this.callParent(arguments); }});

Page 29: RIA - Entwicklung mit Ext JS

Ext.define('IPC.grid.Panel', { extend: 'Ext.grid.Panel', title : 'All Users', region: 'west', width: 200, loadMask: true, initComponent: function() { this.store = 'IPC.store.GridPanel'; this.columns = [ {header: 'Name', dataIndex: 'name'}, {header: 'Email', dataIndex: 'email'} ]; this.callParent(arguments); }});

Page 30: RIA - Entwicklung mit Ext JS

Ext.define('IPC.grid.Panel', { extend: 'Ext.grid.Panel', title : 'All Users', region: 'west', width: 200, loadMask: true, initComponent: function() { this.store = 'IPC.store.GridPanel'; this.columns = [ {header: 'Name', dataIndex: 'name'}, {header: 'Email', dataIndex: 'email'} ]; this.callParent(arguments); }});

Page 31: RIA - Entwicklung mit Ext JS

Ext.define('IPC.grid.Panel', { extend: 'Ext.grid.Panel', title : 'All Users', region: 'west', width: 200, loadMask: true, initComponent: function() { this.store = 'IPC.store.GridPanel'; this.columns = [ {header: 'Name', dataIndex: 'name'}, {header: 'Email', dataIndex: 'email'} ]; this.callParent(arguments); }});

Page 32: RIA - Entwicklung mit Ext JS

Ext.define('IPC.grid.Panel', { extend: 'Ext.grid.Panel', title : 'All Users', region: 'west', width: 200, loadMask: true, initComponent: function() { this.store = 'IPC.store.GridPanel'; this.columns = [ {header: 'Name', dataIndex: 'name'}, {header: 'Email', dataIndex: 'email'} ]; this.callParent(arguments); }});

Page 33: RIA - Entwicklung mit Ext JS

gridPanel = Ext.create('IPC.grid.Panel');

Page 34: RIA - Entwicklung mit Ext JS

Ext.define('IPC.grid.Panel', { extend: 'Ext.grid.Panel', title : 'All Users', region: 'west', width: 200, columns: [ {header: 'Name', dataIndex: 'name'}, {header: 'Email', dataIndex: 'email'} ], loadMask: true, initComponent: function() { this.store = 'IPC.store.GridPanel'; this.callParent(arguments); }});

Page 35: RIA - Entwicklung mit Ext JS

Ext.define

Page 36: RIA - Entwicklung mit Ext JS

Mixins, Plugins & Features

Page 37: RIA - Entwicklung mit Ext JS

Events

Page 38: RIA - Entwicklung mit Ext JS

initComponent: function() { ... this.listeners = { itemdblclick: function(grid, record, item, index, event) { var email = record.get('email'); Ext.Msg.show({ title: 'Email-Adresse', msg: email, buttons: Ext.Msg.OK, icon: Ext.Msg.INFO }); } }; ...}

Page 39: RIA - Entwicklung mit Ext JS

initComponent: function() { ... this.listeners = { itemdblclick: function(grid, record, item, index, event) { var email = record.get('email'); Ext.Msg.show({ title: 'Email-Adresse', msg: email, buttons: Ext.Msg.OK, icon: Ext.Msg.INFO }); } }; ...}

Page 40: RIA - Entwicklung mit Ext JS

gridPanel = Ext.create('IPC.grid.Panel');

gridPanel.on('itemdblclick', function(grid, record) { panel.setTitle(record.get('name'));});

Page 41: RIA - Entwicklung mit Ext JS

Events

Page 42: RIA - Entwicklung mit Ext JS

xtypes / lazy initialization

Page 43: RIA - Entwicklung mit Ext JS

Ext.onReady(function() { var viewport; viewport = Ext.create( 'Ext.container.Viewport', { items: [ { xtype: 'gridpanel', store: 'IPC.grid.Panel', columns: [] } ] } );});

Page 44: RIA - Entwicklung mit Ext JS
Page 45: RIA - Entwicklung mit Ext JS
Page 46: RIA - Entwicklung mit Ext JS

„classes under the hood“

http://edspencer.net/2011/01/classes-in-ext-js-4-under-the-hood.html

Page 47: RIA - Entwicklung mit Ext JS

Ext.core

Page 48: RIA - Entwicklung mit Ext JS

Ext.direct

Page 49: RIA - Entwicklung mit Ext JS

REST

Page 50: RIA - Entwicklung mit Ext JS

MVC

Page 51: RIA - Entwicklung mit Ext JS

Menü

Page 52: RIA - Entwicklung mit Ext JS

TreePanel

Page 53: RIA - Entwicklung mit Ext JS

Theming

Page 54: RIA - Entwicklung mit Ext JS
Page 55: RIA - Entwicklung mit Ext JS
Page 56: RIA - Entwicklung mit Ext JS
Page 57: RIA - Entwicklung mit Ext JS

Ext.draw

Page 58: RIA - Entwicklung mit Ext JS

Ext Designer

Page 59: RIA - Entwicklung mit Ext JS

IDEAptana, Spket, IntelliJ

Page 61: RIA - Entwicklung mit Ext JS

docs.sencha.com

Page 62: RIA - Entwicklung mit Ext JS

JSLINT

Page 63: RIA - Entwicklung mit Ext JS

Sencha Touch

Page 64: RIA - Entwicklung mit Ext JS

Beispiele Musterlösungen:http://bit.ly/p4Nbwu

http://joind.in/talk/view/3826

@muhdiekuh@djungowski