Top Banner
IBM Brasil © 2010 IBM Corporation Loiane Groner [email protected] Nov/2010
49

ExtJS Overview

Dec 18, 2014

Download

Technology

Loiane Groner

My presentation about ExtJS at IBM
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ExtJS Overview

IBM Brasil

© 2010 IBM Corporation

Loiane Groner – [email protected]

Nov/2010

Page 2: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

About me

5+ years of web development experience

Java/ExtJS – Team Leader - IT Specialist at IBM Brazil

– International project – US client

Java/JEE/XML/ExtJS Technical Leader at IBM

IBM Academic Initiative Ambassador

JUG Leader at CampinasJUG/Java Campinas

(Brazilian JUG – Java User Group)

JUG Coordinator at ESJUG (Brazilian JUG)

2

Page 3: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

3

Page 4: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010 4

Page 5: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010 5

YUI Lacked:

• Easy to use API

• Real World Widgets

Page 6: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

6

Page 7: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Windows looks like OS windows – support

dragging/resizing/closing

7

Page 8: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010 8

Page 9: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Good Documentation

9

Page 10: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Community Support

10

Page 11: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Commercial and Open Source License

11

Page 12: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Cross Browser

12

Page 13: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Adapters

13

Page 14: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

14

Page 15: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Data Grid

15

support paging/filtration/sorting/grouping/editor/RESTful

Easy to load/save data to server in different formats – xml/json

Page 16: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Window

16

Confirm

Prompt

Yes, No,

Cancel

Progress

Dialog

Wait Dialog

Icon Alert

Window with

components

Page 17: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Tree Panel

17

support drag and drop/multiple trees/reordering/checkbox

Easy to load/save data to server in different formats – xml/json

Page 18: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Combo Boxes

18

support autocomplete/typing/ajax/search/adavanced template

Easy to load/save data to server in different formats – xml/json

Page 19: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Forms

19

support ajax/file upload, calendar, etc

Easy to load/save data to server in different formats – xml/json

Page 20: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Charts

20

Dynamic – supports reloading on run time

Requires Flash

Page 21: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Calendar

21

Google Calendar – same functions

Ext JS 3.3+

Page 22: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Google Maps, Gears and Adobe Air Integration

22

Page 23: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Themes

23

Easy to customize

Page 24: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

What Else Ext JS Can Do?

Ajax support

Dom traversing

Dom manipulation

Event Handling

Selectors

OOP emulation

Animation

24

Page 25: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

25

Page 26: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Hello World using Eclipse IDE – Java project

Donwload:

http://sencha.com/products/extjs/

download.php

Create a Dynamic Web Project.

Under WebContent folder, create

a folder where all ExtJS files will

be located (I named it ext-3.0.3).

Paste adapter and resources

folders under your extjs folder.

Also, paste this file: ext-

all.js under ext-3.0.3:

26

Page 27: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010 27

Page 28: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Hello World

28

Page 29: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010 29

Page 30: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Ext JS and Base Library Relations

30

Page 31: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Main Ext JS Classes

Component

Panel

Container

Store

31

Page 32: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Component All widgets extends component class

Provide base widget functions like

− enable()/disable()

− show()/hide()

− addClass()/removeClass()

− update(data/html) – update content area

− getEl() return element

− getId()

− getXType()

− render(target)

− focus()

XType – alternate way to define component

− Lazy component creation

var panel1 = {

xtype : 'panel',

title : 'Plain Panel',

html : 'Panel with an xtype specified'

}

var myPanel = new Ext.Panel({

renderTo : document.body,

height : 50,

width : 150,

title : 'Panel',

frame : true

Components are managed by Ext.ComponentMgr

− get(componentId)

− registerType(xtype, object) (shorthand Ext.reg())

32

Page 33: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Containers

handle the basic behavior of containing items, namely adding, inserting and removing items

Main functions

− add()

− remove()/removeAll()

− insert()

− find()/findBy()/findById()/findByType

− doLayout()

− get(index or id)/getComponent(component or

index or id)

Main prop

− Items - MixedCollection of children components

33

Page 34: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Panels Main panel functions/prop/conf prop

− load() ▪ panel.load({

▪ url: 'your-url.php',

▪ params: {param1: 'foo', param2: 'bar'}, // or a URL encoded string

▪ callback: yourFunction,

▪ scope: yourObject, // optional scope for the callback

▪ discardUrl: false,

▪ nocache: false,

▪ text: 'Loading...',

▪ timeout: 30,

▪ scripts: false

▪ });

− body – prop

− html – conf prop

− autoLoad – conf prop

Toolbar and Bottombar

Panel subclasses

− TabPanel

− Window

− FormPanel

− GridPanel

− TreePanel

34

Page 35: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Stores

Data storage/Loading

Store contains records object which contain a server data directly

− Store is able to insert/update/add records

SubClasses

− ArrayStore: Store + ArrayReader – plain js array can be loaded into the array store

− DirectStore: Store + DirectProxy + JsonReader - CRUD operation is going thought custom js method

− GroupingStore: store for grid rows grouping

− JsonStore: Store + JsonReader

− XmlStore: Store + XmlReader

35

Page 36: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Stores

Main exchange format: XML and JSON

Easy to integrate – any language/framework with XML or JSON

support:

36

Page 37: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Layout Manager

Layouts manages by containers – there is

no need to create Layouts directly

The most useful are Fit, VBox, HBox,

Border

−Only VBox, HBox, Border layouts

supports margins

Flex prop of VBox, HBox

BorderLayout must have center item

Table layout does not support resizing of

items

37

Page 39: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

39

Page 40: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Selenium IDE

Firefox Extension

List of Commands

Selenium Locators – Xpath Expressions

Example expressions look like this:

//input[@name='name']

//input[@name='name' and contains(@class, 'x-form-invalid')]

//input[@name='company']/following-sibling::img

//div[@id='Apple']

//div[@class='x-combo-list-item'][3]

Examples using CSS selectors:

css=html:root

css=div#structuralPseudo :nth-last-child(2)

css=a[class~="class2"]

40

Page 41: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Executing Tests with Selenium Remote Control (RC)

41

Programming Language

HTTP Proxy

Page 42: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Java Test

42

Page 43: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Important!

Selenium tests for ExtJS should rely on CSS selectors. For every button, grid,

label, tab or any significant UI element, simply chose to use the cls attribute

and specify a CSS class.

This is how a basic button that is used in automation testing looks like:

43

Page 44: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Use Ext JS

Complex UI

Features

44

Simple UI

Single Component

DO NOT Use Ext JS

Page 45: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Resources

http://www.sencha.com

http://www.extjs.com.br – Brazilian forum

45

Page 46: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Books

46

Page 47: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010 47

Page 48: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

Contact

English blog: http://loianegroner.com

Portuguese-Brazil blog: http://loiane.com

Twitter: @loiane

48

Page 49: ExtJS Overview

IBM Market Insights

© 2010 IBM Corporation Technical Session | Ext JS Overview – November 2010

49

Thank You Grazie

Gracias Obrigado

Danke

Japanese

Hebrew

English

Russian

German

Italian

Spanish

Brazilian Portuguese

Ar4abic

Traditional Chinese

Simplified Chinese

Hindi

Tamil

Korean Thai

Danku Dutch

Merci French