SlideShare a Scribd company logo
1 of 34
Download to read offline
Wednesday, November 2, 2011
MIGRATING TO TOUCH 2
                              Jamie Avins



                              @jamieavins




Wednesday, November 2, 2011
Rendering




Wednesday, November 2, 2011
Rendering in Touch 2
                 Touch 1 combinedthis process into two distinct pieces
                    Touch 2 splits Element creation and DOM placement




                                      Creation
                                     Placement




Wednesday, November 2, 2011
Rendering in Touch 2
                 Touch 1 combinedthis process into two distinct pieces
                    Touch 2 splits Element creation and DOM placement




                                      Creation
                                     Placement




Wednesday, November 2, 2011
Rendering in Touch 2
                 Touch 1 combinedthis process into two distinct pieces
                    Touch 2 splits Element creation and DOM placement




                              Creation
                                                 Placement




Wednesday, November 2, 2011
Rendering in Touch 2
       The Element Creation process is now part of Component
       instantiation

       The Elements initially exist outside the DOM

       You don’t want measure elements until they enter the DOM




Wednesday, November 2, 2011
Rendering in Touch 2
       Touch 1 stored a DOM markup on the prototype

       Touch 2 stores a DOM element on the prototype

       element.cloneNode(true) for all instances




Wednesday, November 2, 2011
Rendering in Touch 2
       Adding a Component to a Container will move its elements
       inside the DOM - fires the ‘painted’ event

       Removing a Component from a Container will move its elements
       outside the DOM - fires the ‘erased’ event

       Component.show() will place the Component in the ViewPort




Wednesday, November 2, 2011
Rendering in Touch 2
       Being able to ‘erase’ components from the DOM and using
       clean configurations allows the recycling of components
    for (; i >= 0; i--) {
        item = items[from + i];
        if (cacheLn !== maxItemCache) {
            me.remove(item, false);
            item.removeCls([me.getPressedCls(), me.getSelectedCls()]);
            itemCache.push(item);
            cacheLn++;
        }
        else {
            item.destroy();
        }
    }


Wednesday, November 2, 2011
Rendering in Touch 2
       Being able to ‘erase’ components from the DOM and using
       clean configurations allows the recycling of components
    for (; i < ln; i++) {
        record = records[i];
        if (cacheLn) {
            cacheLn--;
            item = itemCache.pop();
            item.setRecord(record);
            items.push(item);
        }
        else {
            items.push(me.getDataItemConfig(xtype, record, itemConfig));
        }
    }


Wednesday, November 2, 2011
Rendering in Touch 2
       Unsupported Methods:
          render
          afterRender

       The ‘render’ event is slated for deprecation




Wednesday, November 2, 2011
CSS Layouts




Wednesday, November 2, 2011
Layouts in Touch 2
       Layouts are now completely CSS Based




Wednesday, November 2, 2011
Layouts in Touch 2
       Layouts are now completely CSS Based
                                             .x-layout-hbox, .x-layout-vbox {
       .x-layout-card {                          display: -webkit-box;
                                                 > * {                              .x-docking-horizontal {
           position: relative;
                                                     -webkit-box-flex: 0;               display: -webkit-box;
           overflow: hidden;
                                                 }                                      -webkit-box-flex: 1;
                                             }                                          -webkit-box-orient: horizontal;
           > .x-layout-card-item {
                                                                                        min-width: 100%;
               position: absolute !important;
                                              .x-layout-hbox {                          min-height: 100%;
               width: 100%;
                                                  -webkit-box-orient: horizontal;   }
               height: 100%;
           }
       }                                          > .x-layout-box-item {
                                                                                    .x-layout-fit {
                                                      width: 0 !important;
                                                                                        position: relative;
       .x-docking-vertical {                      }
                                                                                        display: -webkit-box;
           display: -webkit-box;              }
            -webkit-box-flex: 1;                                                        > * {
            -webkit-box-orient: vertical;    .x-layout-vbox {
                                                                                            -webkit-box-flex: 1;
            min-width: 100%;                     -webkit-box-orient: vertical;
                                                                                            min-width: 100%;
            min-height: 100%;                                                               min-height: 100%;
       }                                         > .x-layout-box-item {
                                                                                        }
                                                     height: 0 !important;
                                                                                    }
                                                 }
                                             }




Wednesday, November 2, 2011
Layouts in Touch 2
       Place elements in the appropriate DOM location

       Apply CSS Layout classes

       Apply layout configurations such as pack, flex, align, etc.

       Wrap components for docking and centering




Wednesday, November 2, 2011
Layouts in Touch 2
       Unsupported Methods:
          doLayout
          doComponentLayout
          afterLayout




Wednesday, November 2, 2011
Layouts in Touch 2
       Without afterLayout, how can you detect size changes?
               Scroller
               NavigationBar
               Slider
               DrawComponent




Wednesday, November 2, 2011
Layouts in Touch 2
       Without afterLayout, how can you detect size changes?
               Scroller
               NavigationBar
               Slider
               DrawComponent

       new Ext.util.SizeMonitor({
           element: this.element,
           callback: this.onSizeChange,
           scope: this
       });




Wednesday, November 2, 2011
Layouts in Touch 2
        How does SizeMonitor work?           Target Element


             Add two absolutely
                                            Detect Shrinking
             positioned elements with
             scroll listeners

             If position and scroll don’t
             match, we run our callback     Detect Expanding




Wednesday, November 2, 2011
Layouts in Touch 2
     Docking moved to Container




Wednesday, November 2, 2011
Layouts in Touch 2
     Docking moved to Container

             Remove Panel overnesting

             Removed DataPanel

             ‘dockedItems’ deprecated

             Dynamic Docking - dock configuration now accepts a boolean




Wednesday, November 2, 2011
Layouts in Touch 2
       Setting top, left, bottom, or right will now float your component

           ‘floating’ configuration deprecated

           percentage configuration for top, left, bottom, right, height,
           and width are now supported

                                config: {
                                    top: '20%',
                                    left: '10%',
                                    right: '10%',
                                    bottom: '20%'
                                },



Wednesday, November 2, 2011
Configuration




Wednesday, November 2, 2011
Configuration in Touch 2
       Proper configurations are now used throughout Touch 2

       Using proper getter and setters maintains the configuration
       lifecycle




Wednesday, November 2, 2011
Configuration in Touch 2
       Getters provide:

           Lazy instantiation of the configuration on the first call

           Ensures the initial configuration is passed through the setter

           Configuration dependency handling




Wednesday, November 2, 2011
Configuration in Touch 2
       Setters provide:

           Execution of an optional apply method

           A simple check for a change in value and a call to an optional
           update method




Wednesday, November 2, 2011
Configuration in Touch 2
       Using Apply effectively: Filtering

       applyValue: function(value) {
           var minValue = this.getMinValue(),
               maxValue = this.getMaxValue();

           value = parseFloat(Math.min(Math.max(value, minValue),
       maxValue));

                if (isNaN(value)) {
                    value = this.getDefaultValue();
                }

                return value;
       },


Wednesday, November 2, 2011
Configuration in Touch 2
       Using Apply effectively: Validation

       applyActiveTab: function(activeTab) {
           if (!activeTab && activeTab !== 0) {
               return;
           }

                var activeTabInstance = this.parseActiveTab(activeTab);
                if (!activeTabInstance) {
                    // <debug warn>
                    Ext.Logger.warn('Trying to set a non-existent activeTab');
                    // </debug>
                    return;
                }
                return activeTabInstance;
       },
Wednesday, November 2, 2011
Configuration in Touch 2
       Using Apply effectively: Transformation

       applyLabel: function(config) {
           if (typeof config == "string") {
               config = {
                   text: config
               };
           }

                return Ext.factory(config, 'Ext.form.Label', this.getLabel());
       },




Wednesday, November 2, 2011
Configuration in Touch 2
       Using Update effectively: Updating Dependencies

       updateContentEl: function(newContentEl, oldContentEl) {
           // Take care of the old contentEl
           if (oldContentEl) {
               oldContentEl.hide();
               Ext.getBody().append(oldContentEl);
           }
           // Take care of the new contentEl
           if (newContentEl) {
               this.setHtml(newContentEl);
               newContentEl.show();
           }
       },


Wednesday, November 2, 2011
Configuration in Touch 2
       Wither initComponent

       initComponent : function() {
           ...

                if (!this.store) {
                    this.store = new Ext.data.Store({
                        model: 'IndexBarModel'
                    });
                }

                if (this.alphabet == true) {
                    this.ui = this.ui || 'alphabet';
                }



Wednesday, November 2, 2011
Configuration in Touch 2
       Wither initComponent




Wednesday, November 2, 2011
THANK YOU!
                                Jamie Avins



                                @jamieavins




Wednesday, November 2, 2011

More Related Content

Similar to Migrating from Touch 1.x to 2.0

Ext GWT 3.0 Theming and Appearances
Ext GWT 3.0 Theming and AppearancesExt GWT 3.0 Theming and Appearances
Ext GWT 3.0 Theming and AppearancesSencha
 
Understanding Flexbox Layout in React Native.pdf
Understanding Flexbox Layout in React Native.pdfUnderstanding Flexbox Layout in React Native.pdf
Understanding Flexbox Layout in React Native.pdfKaty Slemon
 
Putting Flexbox into Practice (Fronteers)
Putting Flexbox into Practice (Fronteers)Putting Flexbox into Practice (Fronteers)
Putting Flexbox into Practice (Fronteers)Zoe Gillenwater
 
Css layout
Css layoutCss layout
Css layoutclub23
 
Academy PRO: React native - navigation
Academy PRO: React native - navigationAcademy PRO: React native - navigation
Academy PRO: React native - navigationBinary Studio
 

Similar to Migrating from Touch 1.x to 2.0 (8)

Greg rewis move-itsession
Greg rewis move-itsessionGreg rewis move-itsession
Greg rewis move-itsession
 
Ext GWT 3.0 Theming and Appearances
Ext GWT 3.0 Theming and AppearancesExt GWT 3.0 Theming and Appearances
Ext GWT 3.0 Theming and Appearances
 
INTRODUCTIONS OF CSS PART 2
INTRODUCTIONS OF CSS PART 2INTRODUCTIONS OF CSS PART 2
INTRODUCTIONS OF CSS PART 2
 
Understanding Flexbox Layout in React Native.pdf
Understanding Flexbox Layout in React Native.pdfUnderstanding Flexbox Layout in React Native.pdf
Understanding Flexbox Layout in React Native.pdf
 
Putting Flexbox into Practice (Fronteers)
Putting Flexbox into Practice (Fronteers)Putting Flexbox into Practice (Fronteers)
Putting Flexbox into Practice (Fronteers)
 
Css layout
Css layoutCss layout
Css layout
 
Academy PRO: React native - navigation
Academy PRO: React native - navigationAcademy PRO: React native - navigation
Academy PRO: React native - navigation
 
CSS3 Refresher
CSS3 RefresherCSS3 Refresher
CSS3 Refresher
 

More from Sencha

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 ComponentsSencha
 
Ext JS 6.6 Highlights
Ext JS 6.6 HighlightsExt JS 6.6 Highlights
Ext JS 6.6 HighlightsSencha
 
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
 
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
 
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 TestingSencha
 
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 TestSencha
 
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
 
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 ToolingSencha
 
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
 
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 FirstSencha
 
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 BeyondSencha
 
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 GridSencha
 
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 ReportSencha
 
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 AppsSencha
 
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 BrocatoSencha
 
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...Sencha
 
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...Sencha
 
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 AppsSencha
 
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 SimeonsSencha
 
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...Sencha
 

More from 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...
 

Recently uploaded

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
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 Servicegiselly40
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
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...Drew Madelung
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
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...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

Migrating from Touch 1.x to 2.0

  • 2. MIGRATING TO TOUCH 2 Jamie Avins @jamieavins Wednesday, November 2, 2011
  • 4. Rendering in Touch 2 Touch 1 combinedthis process into two distinct pieces Touch 2 splits Element creation and DOM placement Creation Placement Wednesday, November 2, 2011
  • 5. Rendering in Touch 2 Touch 1 combinedthis process into two distinct pieces Touch 2 splits Element creation and DOM placement Creation Placement Wednesday, November 2, 2011
  • 6. Rendering in Touch 2 Touch 1 combinedthis process into two distinct pieces Touch 2 splits Element creation and DOM placement Creation Placement Wednesday, November 2, 2011
  • 7. Rendering in Touch 2 The Element Creation process is now part of Component instantiation The Elements initially exist outside the DOM You don’t want measure elements until they enter the DOM Wednesday, November 2, 2011
  • 8. Rendering in Touch 2 Touch 1 stored a DOM markup on the prototype Touch 2 stores a DOM element on the prototype element.cloneNode(true) for all instances Wednesday, November 2, 2011
  • 9. Rendering in Touch 2 Adding a Component to a Container will move its elements inside the DOM - fires the ‘painted’ event Removing a Component from a Container will move its elements outside the DOM - fires the ‘erased’ event Component.show() will place the Component in the ViewPort Wednesday, November 2, 2011
  • 10. Rendering in Touch 2 Being able to ‘erase’ components from the DOM and using clean configurations allows the recycling of components for (; i >= 0; i--) { item = items[from + i]; if (cacheLn !== maxItemCache) { me.remove(item, false); item.removeCls([me.getPressedCls(), me.getSelectedCls()]); itemCache.push(item); cacheLn++; } else { item.destroy(); } } Wednesday, November 2, 2011
  • 11. Rendering in Touch 2 Being able to ‘erase’ components from the DOM and using clean configurations allows the recycling of components for (; i < ln; i++) { record = records[i]; if (cacheLn) { cacheLn--; item = itemCache.pop(); item.setRecord(record); items.push(item); } else { items.push(me.getDataItemConfig(xtype, record, itemConfig)); } } Wednesday, November 2, 2011
  • 12. Rendering in Touch 2 Unsupported Methods: render afterRender The ‘render’ event is slated for deprecation Wednesday, November 2, 2011
  • 14. Layouts in Touch 2 Layouts are now completely CSS Based Wednesday, November 2, 2011
  • 15. Layouts in Touch 2 Layouts are now completely CSS Based .x-layout-hbox, .x-layout-vbox { .x-layout-card { display: -webkit-box; > * { .x-docking-horizontal { position: relative; -webkit-box-flex: 0; display: -webkit-box; overflow: hidden; } -webkit-box-flex: 1; } -webkit-box-orient: horizontal; > .x-layout-card-item { min-width: 100%; position: absolute !important; .x-layout-hbox { min-height: 100%; width: 100%; -webkit-box-orient: horizontal; } height: 100%; } } > .x-layout-box-item { .x-layout-fit { width: 0 !important; position: relative; .x-docking-vertical { } display: -webkit-box; display: -webkit-box; } -webkit-box-flex: 1; > * { -webkit-box-orient: vertical; .x-layout-vbox { -webkit-box-flex: 1; min-width: 100%; -webkit-box-orient: vertical; min-width: 100%; min-height: 100%; min-height: 100%; } > .x-layout-box-item { } height: 0 !important; } } } Wednesday, November 2, 2011
  • 16. Layouts in Touch 2 Place elements in the appropriate DOM location Apply CSS Layout classes Apply layout configurations such as pack, flex, align, etc. Wrap components for docking and centering Wednesday, November 2, 2011
  • 17. Layouts in Touch 2 Unsupported Methods: doLayout doComponentLayout afterLayout Wednesday, November 2, 2011
  • 18. Layouts in Touch 2 Without afterLayout, how can you detect size changes? Scroller NavigationBar Slider DrawComponent Wednesday, November 2, 2011
  • 19. Layouts in Touch 2 Without afterLayout, how can you detect size changes? Scroller NavigationBar Slider DrawComponent new Ext.util.SizeMonitor({ element: this.element, callback: this.onSizeChange, scope: this }); Wednesday, November 2, 2011
  • 20. Layouts in Touch 2 How does SizeMonitor work? Target Element Add two absolutely Detect Shrinking positioned elements with scroll listeners If position and scroll don’t match, we run our callback Detect Expanding Wednesday, November 2, 2011
  • 21. Layouts in Touch 2 Docking moved to Container Wednesday, November 2, 2011
  • 22. Layouts in Touch 2 Docking moved to Container Remove Panel overnesting Removed DataPanel ‘dockedItems’ deprecated Dynamic Docking - dock configuration now accepts a boolean Wednesday, November 2, 2011
  • 23. Layouts in Touch 2 Setting top, left, bottom, or right will now float your component ‘floating’ configuration deprecated percentage configuration for top, left, bottom, right, height, and width are now supported config: { top: '20%', left: '10%', right: '10%', bottom: '20%' }, Wednesday, November 2, 2011
  • 25. Configuration in Touch 2 Proper configurations are now used throughout Touch 2 Using proper getter and setters maintains the configuration lifecycle Wednesday, November 2, 2011
  • 26. Configuration in Touch 2 Getters provide: Lazy instantiation of the configuration on the first call Ensures the initial configuration is passed through the setter Configuration dependency handling Wednesday, November 2, 2011
  • 27. Configuration in Touch 2 Setters provide: Execution of an optional apply method A simple check for a change in value and a call to an optional update method Wednesday, November 2, 2011
  • 28. Configuration in Touch 2 Using Apply effectively: Filtering applyValue: function(value) { var minValue = this.getMinValue(), maxValue = this.getMaxValue(); value = parseFloat(Math.min(Math.max(value, minValue), maxValue)); if (isNaN(value)) { value = this.getDefaultValue(); } return value; }, Wednesday, November 2, 2011
  • 29. Configuration in Touch 2 Using Apply effectively: Validation applyActiveTab: function(activeTab) { if (!activeTab && activeTab !== 0) { return; } var activeTabInstance = this.parseActiveTab(activeTab); if (!activeTabInstance) { // <debug warn> Ext.Logger.warn('Trying to set a non-existent activeTab'); // </debug> return; } return activeTabInstance; }, Wednesday, November 2, 2011
  • 30. Configuration in Touch 2 Using Apply effectively: Transformation applyLabel: function(config) { if (typeof config == "string") { config = { text: config }; } return Ext.factory(config, 'Ext.form.Label', this.getLabel()); }, Wednesday, November 2, 2011
  • 31. Configuration in Touch 2 Using Update effectively: Updating Dependencies updateContentEl: function(newContentEl, oldContentEl) { // Take care of the old contentEl if (oldContentEl) { oldContentEl.hide(); Ext.getBody().append(oldContentEl); } // Take care of the new contentEl if (newContentEl) { this.setHtml(newContentEl); newContentEl.show(); } }, Wednesday, November 2, 2011
  • 32. Configuration in Touch 2 Wither initComponent initComponent : function() { ... if (!this.store) { this.store = new Ext.data.Store({ model: 'IndexBarModel' }); } if (this.alphabet == true) { this.ui = this.ui || 'alphabet'; } Wednesday, November 2, 2011
  • 33. Configuration in Touch 2 Wither initComponent Wednesday, November 2, 2011
  • 34. THANK YOU! Jamie Avins @jamieavins Wednesday, November 2, 2011