SlideShare una empresa de Scribd logo
1 de 28
Descargar para leer sin conexión
Ext JS 4:
               Advanced Expert Techniques

                             Rich Waters

                            SenchaCon - 10/25/11




Wednesday, November 2, 11
About Me

                            Chief Application Architect & Founder @ Extnd LLC

                            Ext JS Developer since 2006

                              YUI-Ext 0.3.x

                            Javascript, Ext JS & Sencha Touch Instructor

                              Ext 2.x - 4.x, Touch 1.x (2.x soon!)



Wednesday, November 2, 11
Components


  {con g}




Wednesday, November 2, 11
Wednesday, November 2, 11
Wednesday, November 2, 11
Component Lifecycle
                                  Initialization




                                   Rendering


                                  Destruction


Wednesday, November 2, 11
Intialization Overview


                            Instantiate Class

                            Parse & Apply Con gurations

                            De ne Events

                            [Container] Initialize items




Wednesday, November 2, 11
Instantiate Class


                            Ext.ClassManager.instantiate (Ext.create)

                            Locate class [lookup xtype]

                               Fires Synchronous load call if not present

                            Call class constructor




Wednesday, November 2, 11
Constructor
                            Not just traditional con g object

                              con g.initialCon g

                              con g.tagName || con g.dom

                            Ext.apply {con g}

                            addEvents

                            Generate id

                            call initComponent

Wednesday, November 2, 11
initComponent

                            Initialize event listeners

                            Enable bubbleEvents

                            [Container] initItems

                               Create items MixedCollection

                               Recurse add on items




Wednesday, November 2, 11
[Container] add

                            Apply defaults

                            Lookup or Create component

                            Event: beforeadd

                            Call onBeforeAdd

                            Inject component into items MixedCollection



Wednesday, November 2, 11
[Container] add


                            Call child Component.onAdded

                              Event: added

                            Call onAdd

                            Event: add




Wednesday, November 2, 11
Constructor


                            Register with ComponentManager

                            Initialize Obserable/State mixins

                            Initialize plugins

                            Call renderTo / autoShow




Wednesday, November 2, 11
Rendering Overview


                            Generate DOM using XTemplate

                            Insert DOM Nodes

                            Gather DOM references

                            Calculate layouts




Wednesday, November 2, 11
Render


                            Event: beforerender

                            Get container reference (if any)

                            Call onRender




Wednesday, November 2, 11
onRender

                            Initialize inline styles/padding/margin

                            Build DOM (autoEl)

                            Append DOM to page

                            IE frame con g support (wrap with tr/tc/tl/mr/
                            mc/etc.)




Wednesday, November 2, 11
onRender

                            Build renderTpl

                            Initialize renderData

                               Add classnames (baseCls, componentCls,
                               additionalCls, ui class)

                            Append HTML to DOM

                            Initialize renderSelectors / childEls



Wednesday, November 2, 11
render


                            Make visible

                            Event: render

                            Initialize content (html/contentEl/data+tpl)

                            Call afterRender




Wednesday, November 2, 11
afterRender



                            Create Layout

                            Call Layout’s layout




Wednesday, November 2, 11
layout
                            Call beforeLayout

                              [Container] renderItems

                            Create componentLayout

                            Call afterLayout

                              Call afterComponentLayout

                              Event: resize

                            doOwnerCtLayouts

Wednesday, November 2, 11
afterRender


                            Initalize resizable

                            Initalize draggable

                            Initalize ARIA roles




Wednesday, November 2, 11
render


                            Event: afterrender

                            Call initEvents

                            Initialize hidden/disabled




Wednesday, November 2, 11
Destruction Overview


                            Destroy DOM nodes

                            Free event handlers

                            [Container] Destroy children

                            Clean up references




Wednesday, November 2, 11
destroy
                            Event: beforedestroy

                            Call beforeDestroy

                              Component speci c removal

                            Remove from ownerCt

                            Call onDestroy

                              Removes internal refs (proxy/resizer/
                              componentLayout/loadMask/ oatingItems)


Wednesday, November 2, 11
destroy

                            Destroy plugins

                            Remove DOM node

                            Event: destroy

                            Unregister with ComponentManager

                            Clear event listeners

                            Remove element refs


Wednesday, November 2, 11
Code!
                            Custom component excessively nesting panels & not
                            optimizing events

                            Quick side track - Event Delegation

                            Custom component rewritten using renderTpl/
                            renderData/childEls/delegated events

                            Second renderTpl example - MultiSortTemplateColumn

                            Utility function examples (TextMetrics/
                            MixedCollection/DelayedTask)


Wednesday, November 2, 11
Additional Resources


                            http://sencha.com/learn/components

                            Ext JS in Action (4 MEAP)

                              http://manning.com/garcia3/




Wednesday, November 2, 11
Questions?


                                 Rich Waters
                                   @rwaters
                            http://zerp.ly/rwaters




Wednesday, November 2, 11

Más contenido relacionado

Similar a Ext JS 4: Advanced Expert Techniques

TripCase Unit Testing with Jasmine
TripCase Unit Testing with JasmineTripCase Unit Testing with Jasmine
TripCase Unit Testing with Jasmine
Stephen Pond
 
Rcos presentation
Rcos presentationRcos presentation
Rcos presentation
mskmoorthy
 

Similar a Ext JS 4: Advanced Expert Techniques (10)

Ext GWT 3.0 Data Binding and Editors
Ext GWT 3.0 Data Binding and EditorsExt GWT 3.0 Data Binding and Editors
Ext GWT 3.0 Data Binding and Editors
 
TripCase Unit Testing with Jasmine
TripCase Unit Testing with JasmineTripCase Unit Testing with Jasmine
TripCase Unit Testing with Jasmine
 
Hardware Acceleration on Mobile, Ariya Hidayat & Jarred Nicholls
Hardware Acceleration on Mobile, Ariya Hidayat & Jarred NichollsHardware Acceleration on Mobile, Ariya Hidayat & Jarred Nicholls
Hardware Acceleration on Mobile, Ariya Hidayat & Jarred Nicholls
 
My Favourite 10 Things about Xcode/ObjectiveC
My Favourite 10 Things about Xcode/ObjectiveCMy Favourite 10 Things about Xcode/ObjectiveC
My Favourite 10 Things about Xcode/ObjectiveC
 
Mapnik2 Performance, September 2011
Mapnik2 Performance, September 2011Mapnik2 Performance, September 2011
Mapnik2 Performance, September 2011
 
Ext JS 4.1: Layouts, Performance, and API updates
Ext JS 4.1: Layouts, Performance, and API updatesExt JS 4.1: Layouts, Performance, and API updates
Ext JS 4.1: Layouts, Performance, and API updates
 
PHP Server-side Breakout
PHP Server-side BreakoutPHP Server-side Breakout
PHP Server-side Breakout
 
Migrating from Ext GWT 2.x to 3.0
Migrating from Ext GWT 2.x to 3.0Migrating from Ext GWT 2.x to 3.0
Migrating from Ext GWT 2.x to 3.0
 
Rcos presentation
Rcos presentationRcos presentation
Rcos presentation
 
Big app design for Node.js
Big app design for Node.jsBig app design for Node.js
Big app design for Node.js
 

Más de Sencha

Más de Sencha (20)

Breathe New Life into Your Existing JavaScript Applications with Web Components
Breathe New Life into Your Existing JavaScript Applications with Web ComponentsBreathe New Life into Your Existing JavaScript Applications with Web Components
Breathe New Life into Your Existing JavaScript Applications with Web Components
 
Ext JS 6.6 Highlights
Ext JS 6.6 HighlightsExt JS 6.6 Highlights
Ext JS 6.6 Highlights
 
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
 
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
 
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App TestingSencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
 
Sencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha TestSencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha Test
 
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
 
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
 
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
 
Sencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop FirstSencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop First
 
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and BeyondSencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
 
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data GridLeveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
 
Learn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportLearn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research Report
 
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React AppsIntroducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
 
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark BrocatoSenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
 
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
 
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
 
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
 
Ext JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell SimeonsExt JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell Simeons
 
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 

Ext JS 4: Advanced Expert Techniques

  • 1. Ext JS 4: Advanced Expert Techniques Rich Waters SenchaCon - 10/25/11 Wednesday, November 2, 11
  • 2. About Me Chief Application Architect & Founder @ Extnd LLC Ext JS Developer since 2006 YUI-Ext 0.3.x Javascript, Ext JS & Sencha Touch Instructor Ext 2.x - 4.x, Touch 1.x (2.x soon!) Wednesday, November 2, 11
  • 3. Components {con g} Wednesday, November 2, 11
  • 6. Component Lifecycle Initialization Rendering Destruction Wednesday, November 2, 11
  • 7. Intialization Overview Instantiate Class Parse & Apply Con gurations De ne Events [Container] Initialize items Wednesday, November 2, 11
  • 8. Instantiate Class Ext.ClassManager.instantiate (Ext.create) Locate class [lookup xtype] Fires Synchronous load call if not present Call class constructor Wednesday, November 2, 11
  • 9. Constructor Not just traditional con g object con g.initialCon g con g.tagName || con g.dom Ext.apply {con g} addEvents Generate id call initComponent Wednesday, November 2, 11
  • 10. initComponent Initialize event listeners Enable bubbleEvents [Container] initItems Create items MixedCollection Recurse add on items Wednesday, November 2, 11
  • 11. [Container] add Apply defaults Lookup or Create component Event: beforeadd Call onBeforeAdd Inject component into items MixedCollection Wednesday, November 2, 11
  • 12. [Container] add Call child Component.onAdded Event: added Call onAdd Event: add Wednesday, November 2, 11
  • 13. Constructor Register with ComponentManager Initialize Obserable/State mixins Initialize plugins Call renderTo / autoShow Wednesday, November 2, 11
  • 14. Rendering Overview Generate DOM using XTemplate Insert DOM Nodes Gather DOM references Calculate layouts Wednesday, November 2, 11
  • 15. Render Event: beforerender Get container reference (if any) Call onRender Wednesday, November 2, 11
  • 16. onRender Initialize inline styles/padding/margin Build DOM (autoEl) Append DOM to page IE frame con g support (wrap with tr/tc/tl/mr/ mc/etc.) Wednesday, November 2, 11
  • 17. onRender Build renderTpl Initialize renderData Add classnames (baseCls, componentCls, additionalCls, ui class) Append HTML to DOM Initialize renderSelectors / childEls Wednesday, November 2, 11
  • 18. render Make visible Event: render Initialize content (html/contentEl/data+tpl) Call afterRender Wednesday, November 2, 11
  • 19. afterRender Create Layout Call Layout’s layout Wednesday, November 2, 11
  • 20. layout Call beforeLayout [Container] renderItems Create componentLayout Call afterLayout Call afterComponentLayout Event: resize doOwnerCtLayouts Wednesday, November 2, 11
  • 21. afterRender Initalize resizable Initalize draggable Initalize ARIA roles Wednesday, November 2, 11
  • 22. render Event: afterrender Call initEvents Initialize hidden/disabled Wednesday, November 2, 11
  • 23. Destruction Overview Destroy DOM nodes Free event handlers [Container] Destroy children Clean up references Wednesday, November 2, 11
  • 24. destroy Event: beforedestroy Call beforeDestroy Component speci c removal Remove from ownerCt Call onDestroy Removes internal refs (proxy/resizer/ componentLayout/loadMask/ oatingItems) Wednesday, November 2, 11
  • 25. destroy Destroy plugins Remove DOM node Event: destroy Unregister with ComponentManager Clear event listeners Remove element refs Wednesday, November 2, 11
  • 26. Code! Custom component excessively nesting panels & not optimizing events Quick side track - Event Delegation Custom component rewritten using renderTpl/ renderData/childEls/delegated events Second renderTpl example - MultiSortTemplateColumn Utility function examples (TextMetrics/ MixedCollection/DelayedTask) Wednesday, November 2, 11
  • 27. Additional Resources http://sencha.com/learn/components Ext JS in Action (4 MEAP) http://manning.com/garcia3/ Wednesday, November 2, 11
  • 28. Questions? Rich Waters @rwaters http://zerp.ly/rwaters Wednesday, November 2, 11