SlideShare une entreprise Scribd logo
1  sur  22
Sencha ExtJs Learning[part 1]
Layout and Container in ExtJs
By : Irfan
Maulana
About Layouting in ExtJs
The layout system is one of the most
powerful parts of Ext JS. It handles the
sizing and positioning of
every Component in your application.
Container hierarchy
The most commonly used Container is Panel.
Or you can use container sometimes.
Which Container should I used ?
Published in https://mazipanneh.wordpress.com/2015/05/05/extjs-different-panel-vs-container/
Ext.panel.Panel is extends of container.
Panel more complex and heavier than container.
Container Layouts
Every container has a layout that manages the sizing and positioning of
its child Components
You must specify layout for all Container.
But default layout for all Containers is Auto Layout.
AutoLayout provides only a passthrough of any layout calls to any child
containers.
Component Layouts
Just like a Container’s Layout defines how a Container sizes and positions
its Component items, a Component also has a Layout which defines how it
sizes and positions its internal child items.
Component layouts are configured using the componentLayout config
option.
Generally, you will not need to use this configuration unless you are
writing a custom Component since all of the provided Components come
with their own layout managers.
Most Components use Auto Layout, but more complex Components will
require a custom component layout (for example a Panel that has a header,
footer, and toolbars).
Basic Ext Layout
Absolute
Accordion
Anchor
Border
Card
Column
Fit
Table
Vbox
Hbox
Sample page : http://dev.sencha.com/deploy/ext-4.0.0/examples/layout-browser/layout-
browser.html
Basic Ext Layout - Absolute
This is a simple layout style that allows you to position items within a
container using CSS-style absolute positioning via XY coordinates.
//sample code
layout: 'absolute',
items:[
{
title: 'Panel 1',
x: 50,
y: 50,
html: 'Positioned at x:50, y:50‘
},{
title: 'Panel 2',
x: 125,
y: 125,
html: 'Positioned at x:125, y:125‘
}]
http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.layout.container.Absolute
Basic Ext Layout - Accordion
Displays one panel at a time in a stacked layout. No special config properties are
required other than the layout — all panels added to the container will be converted
to accordion panels.
//sample code
layout: 'accordion',
items:[
{
title: 'Panel 1',
html: 'Content'
},{
title: 'Panel 2',
id: 'panel2',
html: 'Content'
}]
// css
#panel2 .x-panel-body {
background:#ffe;
color:#15428B;
}
#panel2 .x-panel-header-text {
color:#555;
}
http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.layout.container.Accordion
Basic Ext Layout - Anchor
Provides anchoring of contained items to the container's edges. This type of layout is most
commonly seen within FormPanels (or any container with a FormLayout) where fields are
sized relative to the container without hard-coding their dimensions.
//sample code
layout: 'anchor',
items: [{
title: 'Panel 1',
height: 100,
anchor: '50%'
},{
title: 'Panel 2',
height: 100,
anchor: '-100'
},{
title: 'Panel 3',
anchor: '-10, -262'
}]
http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.layout.container.Anchor-cfg-anchor
Basic Ext Layout - Border
This is a multi-pane, application-oriented UI layout style that supports multiple nested
panels, automatic bars between regions and built-in expanding and collapsing of regions.
//sample code
layout:'border',
defaults: {
collapsible: true,
split: true,
bodyStyle: 'padding:15px'
},
items: [{
title: 'Footer',
region: 'south',
height: 150,
minSize: 75,
maxSize: 250,
cmargins: '5 0 0 0‘
},{
title: 'Navigation',
region:'west',
margins: '5 0 0 0',
cmargins: '5 5 0 0',
width: 175,
minSize: 100,
maxSize: 250
},{
title: 'Main Content',
collapsible: false,
region:'center',
margins: '5 0 0 0'http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.layout.container.Border
Basic Ext Layout - Border
Region of Border Layout :
North : Positions component at top.
South : Positions component at bottom.
East : Positions component at right.
West : Positions component at left.
Center : Positions component at the remaining space.
There must be a component with region: "center" in every
border layout.
Basic Ext Layout - Card
This layout manages multiple child Components, each fitted to the Container, where only a
single child Component can be visible at any given time.
This layout style is most commonly used for wizards, tab implementations, etc.
//sample code
layout:'card',
activeItem: 0, // index or id
bbar: ['->',
{
id: 'card-prev',
text: '« Previous'
},{
id: 'card-next',
text: 'Next »‘
}],
items: [
{
id: 'card-0',
html: 'Step 1‘
},{
id: 'card-1',
html: 'Step 2'
},{
id: 'card-2',
html: 'Step 3'
}]http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.layout.container.Card
Basic Ext Layout - Column
This is a useful layout style when you need multiple columns that can have varying
content height.
//sample code
layout:'column',
items: [{
title: 'Width = 25%',
columnWidth: .25,
html: 'Content'
},{
title: 'Width = 75%',
columnWidth: .75,
html: 'Content'
},{
title: 'Width = 250px',
width: 250,
html: 'Content'
}]
http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.layout.container.Column
Basic Ext Layout - Fit
A very simple layout that simply fills the container with a
single panel.
This is usually the best default layout choice when you
have no other specific layout requirements.
//sample code
layout:'fit',
items: {
title: 'Fit Panel',
html: 'Content',
border: false
}
http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.layout.container.Fit
Basic Ext Layout - Table
Outputs a standard HTML table as the layout container.
This is sometimes useful for complex layouts where cell spanning is required, or when you
want to allow the contents to flow naturally based on standard browser table layout rules.
//sample code
layout: {
type: 'table',
columns: 4
},
items: [
{html:'1,1',rowspan:3},
{html:'1,2'},
{html:'1,3'},
{html:'2,2',colspan:2},
{html:'3,2'},
{html:'3,3'}
]
http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.layout.container.Table
Basic Ext Layout - Vbox
A layout that arranges items vertically across a Container. This layout optionally divides
available vertical space between child items containing a numeric flex configuration.
//sample code
layout: {
type: 'vbox‘,
align : 'stretch',
pack : 'start',
},
items: [
{html:'panel 1', flex:1},
{html:'panel 2', height:150},
{html:'panel 3', flex:2}
]
http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.layout.container.VBox
Basic Ext Layout - Hbox
A layout that arranges items horizontally across a Container. This layout optionally divides
available horizontal space between child items containing a numeric flex configuration.
//sample code
layout: {
type: 'hbox',
pack: 'start',
align: 'stretch'
},
items: [
{html:'panel 1', flex:1},
{html:'panel 2', width:150},
{html:'panel 3', flex:2}
]
http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.layout.container.HBox
vBox – hBox Configuration
Align : Controls how the child
items of the container are
aligned.
Pack : Controls how the child
items of the container are
packed together.
Tips
Because ExtJs's layout is nested, so see the
raw design start from bigger (base)
component.
Exersice
Please make layout for this mockup in ExtJs’s ways.
Thanks for your attention.
Presented by : Irfan Maulana
Contact me on :
Email : mazipanneh@gmail.com
Blog : www.mazipanneh.wordpress.com

Contenu connexe

Tendances

Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript
Adieu
 
Javascript operators
Javascript operatorsJavascript operators
Javascript operators
Mohit Rana
 

Tendances (20)

Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript
 
Javascript operators
Javascript operatorsJavascript operators
Javascript operators
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
Javascript basics
Javascript basicsJavascript basics
Javascript basics
 
JavaScript Programming
JavaScript ProgrammingJavaScript Programming
JavaScript Programming
 
CSS
CSSCSS
CSS
 
Dom
DomDom
Dom
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
 
Javascript Basic
Javascript BasicJavascript Basic
Javascript Basic
 
1. HTML
1. HTML1. HTML
1. HTML
 
Object Oriented Javascript
Object Oriented JavascriptObject Oriented Javascript
Object Oriented Javascript
 
jQuery
jQueryjQuery
jQuery
 
Bootstrap PPT by Mukesh
Bootstrap PPT by MukeshBootstrap PPT by Mukesh
Bootstrap PPT by Mukesh
 
Frontend Crash Course: HTML and CSS
Frontend Crash Course: HTML and CSSFrontend Crash Course: HTML and CSS
Frontend Crash Course: HTML and CSS
 
Introduction to HTML
Introduction to HTML Introduction to HTML
Introduction to HTML
 
Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]
 
What is JavaScript? Edureka
What is JavaScript? EdurekaWhat is JavaScript? Edureka
What is JavaScript? Edureka
 
Lets make a better react form
Lets make a better react formLets make a better react form
Lets make a better react form
 
Bootstrap ppt
Bootstrap pptBootstrap ppt
Bootstrap ppt
 

En vedette

Basics of Ext JS
Basics of Ext JSBasics of Ext JS
Basics of Ext JS
ikhwanhayat
 
email clients and webmail (presentation)
email clients and webmail   (presentation)email clients and webmail   (presentation)
email clients and webmail (presentation)
kay2
 

En vedette (14)

Sencha ExtJs Learning Part 2 - MVC And MVVM Architecture in ExtJs [ENGLISH]
Sencha ExtJs Learning Part 2 - MVC And MVVM Architecture in ExtJs [ENGLISH]Sencha ExtJs Learning Part 2 - MVC And MVVM Architecture in ExtJs [ENGLISH]
Sencha ExtJs Learning Part 2 - MVC And MVVM Architecture in ExtJs [ENGLISH]
 
Php Indonesia x Bliblidotcom - Architecting Scalable CSS
Php Indonesia x Bliblidotcom - Architecting Scalable CSSPhp Indonesia x Bliblidotcom - Architecting Scalable CSS
Php Indonesia x Bliblidotcom - Architecting Scalable CSS
 
CP 值很高的 Gulp
CP 值很高的 GulpCP 值很高的 Gulp
CP 值很高的 Gulp
 
Extjs
ExtjsExtjs
Extjs
 
Ext JS Presentation
Ext JS PresentationExt JS Presentation
Ext JS Presentation
 
Ext Js introduction and new features in Ext Js 6
Ext Js introduction and new features in Ext Js 6Ext Js introduction and new features in Ext Js 6
Ext Js introduction and new features in Ext Js 6
 
Ext js 6
Ext js 6Ext js 6
Ext js 6
 
Journey To The Front End World - Part2 - The Cosmetic
Journey To The Front End World - Part2 - The  CosmeticJourney To The Front End World - Part2 - The  Cosmetic
Journey To The Front End World - Part2 - The Cosmetic
 
conjoon - The Open Source Webmail Client
conjoon - The Open Source Webmail Clientconjoon - The Open Source Webmail Client
conjoon - The Open Source Webmail Client
 
Bliblidotcom - SASS Introduction
Bliblidotcom - SASS IntroductionBliblidotcom - SASS Introduction
Bliblidotcom - SASS Introduction
 
Basics of Ext JS
Basics of Ext JSBasics of Ext JS
Basics of Ext JS
 
Journey To The Front End World - Part3 - The Machine
Journey To The Front End World - Part3 - The MachineJourney To The Front End World - Part3 - The Machine
Journey To The Front End World - Part3 - The Machine
 
email clients and webmail (presentation)
email clients and webmail   (presentation)email clients and webmail   (presentation)
email clients and webmail (presentation)
 
Journey To The Front End World - Part1 - The Skeleton
Journey To The Front End World - Part1 - The SkeletonJourney To The Front End World - Part1 - The Skeleton
Journey To The Front End World - Part1 - The Skeleton
 

Similaire à Sencha ExtJs Learning Part 1 - Layout And Container in Sencha ExtJs - By Irfan Maulana [ENGLISH]

Front End Good Practices
Front End Good PracticesFront End Good Practices
Front End Good Practices
Hernan Mammana
 
Developing components and extensions for ext js
Developing components and extensions for ext jsDeveloping components and extensions for ext js
Developing components and extensions for ext js
Mats Bryntse
 
Designing for magento
Designing for magentoDesigning for magento
Designing for magento
hainutemicute
 
Asp.Net 2.0 Presentation
Asp.Net 2.0 PresentationAsp.Net 2.0 Presentation
Asp.Net 2.0 Presentation
sasidhar
 
Creative Web 02 - HTML & CSS Basics
Creative Web 02 - HTML & CSS BasicsCreative Web 02 - HTML & CSS Basics
Creative Web 02 - HTML & CSS Basics
Lukas Oppermann
 
Web topic 9 navigation and link
Web topic 9  navigation and linkWeb topic 9  navigation and link
Web topic 9 navigation and link
CK Yang
 

Similaire à Sencha ExtJs Learning Part 1 - Layout And Container in Sencha ExtJs - By Irfan Maulana [ENGLISH] (20)

skintutorial
skintutorialskintutorial
skintutorial
 
skintutorial
skintutorialskintutorial
skintutorial
 
CSS Frameworks
CSS FrameworksCSS Frameworks
CSS Frameworks
 
HTML and CSS.pptx
HTML and CSS.pptxHTML and CSS.pptx
HTML and CSS.pptx
 
Intro to OctoberCMS
Intro to OctoberCMSIntro to OctoberCMS
Intro to OctoberCMS
 
Front End Good Practices
Front End Good PracticesFront End Good Practices
Front End Good Practices
 
Abstract Window Toolkit
Abstract Window ToolkitAbstract Window Toolkit
Abstract Window Toolkit
 
How to Use Tailwind Config to Customize Theme Styles
How to Use Tailwind Config to Customize Theme StylesHow to Use Tailwind Config to Customize Theme Styles
How to Use Tailwind Config to Customize Theme Styles
 
[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JS[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JS
 
Developing components and extensions for ext js
Developing components and extensions for ext jsDeveloping components and extensions for ext js
Developing components and extensions for ext js
 
Designing for magento
Designing for magentoDesigning for magento
Designing for magento
 
Building Rich Internet Applications with Ext JS
Building Rich Internet Applications  with Ext JSBuilding Rich Internet Applications  with Ext JS
Building Rich Internet Applications with Ext JS
 
Asp.Net 2.0 Presentation
Asp.Net 2.0 PresentationAsp.Net 2.0 Presentation
Asp.Net 2.0 Presentation
 
Creative Web 02 - HTML & CSS Basics
Creative Web 02 - HTML & CSS BasicsCreative Web 02 - HTML & CSS Basics
Creative Web 02 - HTML & CSS Basics
 
Web topic 9 navigation and link
Web topic 9  navigation and linkWeb topic 9  navigation and link
Web topic 9 navigation and link
 
The New CSS Layout - Dutch PHP Conference
The New CSS Layout - Dutch PHP ConferenceThe New CSS Layout - Dutch PHP Conference
The New CSS Layout - Dutch PHP Conference
 
AWT.pptx
AWT.pptxAWT.pptx
AWT.pptx
 
Java GUI Programming for beginners-graphics.pdf
Java GUI Programming for beginners-graphics.pdfJava GUI Programming for beginners-graphics.pdf
Java GUI Programming for beginners-graphics.pdf
 
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdfITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
 
Pfnp slides
Pfnp slidesPfnp slides
Pfnp slides
 

Plus de Irfan Maulana

Plus de Irfan Maulana (16)

Modern Web - an Introduction
Modern Web - an IntroductionModern Web - an Introduction
Modern Web - an Introduction
 
Unit Testing for Frontend Code at Blibli.com
Unit Testing for Frontend Code at Blibli.comUnit Testing for Frontend Code at Blibli.com
Unit Testing for Frontend Code at Blibli.com
 
Programmer In Startup Era
Programmer In Startup EraProgrammer In Startup Era
Programmer In Startup Era
 
Bliblidotcom - Evolusi Frontend Development di Bliblidotcom
Bliblidotcom - Evolusi Frontend Development di BliblidotcomBliblidotcom - Evolusi Frontend Development di Bliblidotcom
Bliblidotcom - Evolusi Frontend Development di Bliblidotcom
 
Bliblidotcom - Tech In Asia PDC 2017 Takeaway
Bliblidotcom - Tech In Asia PDC 2017 TakeawayBliblidotcom - Tech In Asia PDC 2017 Takeaway
Bliblidotcom - Tech In Asia PDC 2017 Takeaway
 
Bliblidotcom - AMP And PWA
Bliblidotcom - AMP And PWABliblidotcom - AMP And PWA
Bliblidotcom - AMP And PWA
 
Angular - The Return of The King
Angular - The Return of The KingAngular - The Return of The King
Angular - The Return of The King
 
How to Become Rockstar Programmer
How to Become Rockstar ProgrammerHow to Become Rockstar Programmer
How to Become Rockstar Programmer
 
Bliblidotcom - AngularJS Introduction
Bliblidotcom - AngularJS IntroductionBliblidotcom - AngularJS Introduction
Bliblidotcom - AngularJS Introduction
 
Bliblidotcom - Reintroduction BEM CSS
Bliblidotcom - Reintroduction BEM CSSBliblidotcom - Reintroduction BEM CSS
Bliblidotcom - Reintroduction BEM CSS
 
PHP Indonesia - Understanding UI UX from Developer Side
PHP Indonesia - Understanding UI UX from Developer SidePHP Indonesia - Understanding UI UX from Developer Side
PHP Indonesia - Understanding UI UX from Developer Side
 
JakartaJS - How I Learn Javascript From Basic
JakartaJS - How I Learn Javascript From BasicJakartaJS - How I Learn Javascript From Basic
JakartaJS - How I Learn Javascript From Basic
 
PHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web DevelopmentPHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web Development
 
[Blibli Brown Bag] Nodejs - The Other Side of Javascript
[Blibli Brown Bag] Nodejs - The Other Side of Javascript[Blibli Brown Bag] Nodejs - The Other Side of Javascript
[Blibli Brown Bag] Nodejs - The Other Side of Javascript
 
Create Rest API in Nodejs
Create Rest API in Nodejs Create Rest API in Nodejs
Create Rest API in Nodejs
 
Irfan Maulana - Career Journey
Irfan Maulana - Career JourneyIrfan Maulana - Career Journey
Irfan Maulana - Career Journey
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Sencha ExtJs Learning Part 1 - Layout And Container in Sencha ExtJs - By Irfan Maulana [ENGLISH]

  • 1. Sencha ExtJs Learning[part 1] Layout and Container in ExtJs By : Irfan Maulana
  • 2. About Layouting in ExtJs The layout system is one of the most powerful parts of Ext JS. It handles the sizing and positioning of every Component in your application.
  • 3. Container hierarchy The most commonly used Container is Panel. Or you can use container sometimes.
  • 4. Which Container should I used ? Published in https://mazipanneh.wordpress.com/2015/05/05/extjs-different-panel-vs-container/ Ext.panel.Panel is extends of container. Panel more complex and heavier than container.
  • 5. Container Layouts Every container has a layout that manages the sizing and positioning of its child Components You must specify layout for all Container. But default layout for all Containers is Auto Layout. AutoLayout provides only a passthrough of any layout calls to any child containers.
  • 6. Component Layouts Just like a Container’s Layout defines how a Container sizes and positions its Component items, a Component also has a Layout which defines how it sizes and positions its internal child items. Component layouts are configured using the componentLayout config option. Generally, you will not need to use this configuration unless you are writing a custom Component since all of the provided Components come with their own layout managers. Most Components use Auto Layout, but more complex Components will require a custom component layout (for example a Panel that has a header, footer, and toolbars).
  • 7. Basic Ext Layout Absolute Accordion Anchor Border Card Column Fit Table Vbox Hbox Sample page : http://dev.sencha.com/deploy/ext-4.0.0/examples/layout-browser/layout- browser.html
  • 8. Basic Ext Layout - Absolute This is a simple layout style that allows you to position items within a container using CSS-style absolute positioning via XY coordinates. //sample code layout: 'absolute', items:[ { title: 'Panel 1', x: 50, y: 50, html: 'Positioned at x:50, y:50‘ },{ title: 'Panel 2', x: 125, y: 125, html: 'Positioned at x:125, y:125‘ }] http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.layout.container.Absolute
  • 9. Basic Ext Layout - Accordion Displays one panel at a time in a stacked layout. No special config properties are required other than the layout — all panels added to the container will be converted to accordion panels. //sample code layout: 'accordion', items:[ { title: 'Panel 1', html: 'Content' },{ title: 'Panel 2', id: 'panel2', html: 'Content' }] // css #panel2 .x-panel-body { background:#ffe; color:#15428B; } #panel2 .x-panel-header-text { color:#555; } http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.layout.container.Accordion
  • 10. Basic Ext Layout - Anchor Provides anchoring of contained items to the container's edges. This type of layout is most commonly seen within FormPanels (or any container with a FormLayout) where fields are sized relative to the container without hard-coding their dimensions. //sample code layout: 'anchor', items: [{ title: 'Panel 1', height: 100, anchor: '50%' },{ title: 'Panel 2', height: 100, anchor: '-100' },{ title: 'Panel 3', anchor: '-10, -262' }] http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.layout.container.Anchor-cfg-anchor
  • 11. Basic Ext Layout - Border This is a multi-pane, application-oriented UI layout style that supports multiple nested panels, automatic bars between regions and built-in expanding and collapsing of regions. //sample code layout:'border', defaults: { collapsible: true, split: true, bodyStyle: 'padding:15px' }, items: [{ title: 'Footer', region: 'south', height: 150, minSize: 75, maxSize: 250, cmargins: '5 0 0 0‘ },{ title: 'Navigation', region:'west', margins: '5 0 0 0', cmargins: '5 5 0 0', width: 175, minSize: 100, maxSize: 250 },{ title: 'Main Content', collapsible: false, region:'center', margins: '5 0 0 0'http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.layout.container.Border
  • 12. Basic Ext Layout - Border Region of Border Layout : North : Positions component at top. South : Positions component at bottom. East : Positions component at right. West : Positions component at left. Center : Positions component at the remaining space. There must be a component with region: "center" in every border layout.
  • 13. Basic Ext Layout - Card This layout manages multiple child Components, each fitted to the Container, where only a single child Component can be visible at any given time. This layout style is most commonly used for wizards, tab implementations, etc. //sample code layout:'card', activeItem: 0, // index or id bbar: ['->', { id: 'card-prev', text: '« Previous' },{ id: 'card-next', text: 'Next »‘ }], items: [ { id: 'card-0', html: 'Step 1‘ },{ id: 'card-1', html: 'Step 2' },{ id: 'card-2', html: 'Step 3' }]http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.layout.container.Card
  • 14. Basic Ext Layout - Column This is a useful layout style when you need multiple columns that can have varying content height. //sample code layout:'column', items: [{ title: 'Width = 25%', columnWidth: .25, html: 'Content' },{ title: 'Width = 75%', columnWidth: .75, html: 'Content' },{ title: 'Width = 250px', width: 250, html: 'Content' }] http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.layout.container.Column
  • 15. Basic Ext Layout - Fit A very simple layout that simply fills the container with a single panel. This is usually the best default layout choice when you have no other specific layout requirements. //sample code layout:'fit', items: { title: 'Fit Panel', html: 'Content', border: false } http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.layout.container.Fit
  • 16. Basic Ext Layout - Table Outputs a standard HTML table as the layout container. This is sometimes useful for complex layouts where cell spanning is required, or when you want to allow the contents to flow naturally based on standard browser table layout rules. //sample code layout: { type: 'table', columns: 4 }, items: [ {html:'1,1',rowspan:3}, {html:'1,2'}, {html:'1,3'}, {html:'2,2',colspan:2}, {html:'3,2'}, {html:'3,3'} ] http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.layout.container.Table
  • 17. Basic Ext Layout - Vbox A layout that arranges items vertically across a Container. This layout optionally divides available vertical space between child items containing a numeric flex configuration. //sample code layout: { type: 'vbox‘, align : 'stretch', pack : 'start', }, items: [ {html:'panel 1', flex:1}, {html:'panel 2', height:150}, {html:'panel 3', flex:2} ] http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.layout.container.VBox
  • 18. Basic Ext Layout - Hbox A layout that arranges items horizontally across a Container. This layout optionally divides available horizontal space between child items containing a numeric flex configuration. //sample code layout: { type: 'hbox', pack: 'start', align: 'stretch' }, items: [ {html:'panel 1', flex:1}, {html:'panel 2', width:150}, {html:'panel 3', flex:2} ] http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.layout.container.HBox
  • 19. vBox – hBox Configuration Align : Controls how the child items of the container are aligned. Pack : Controls how the child items of the container are packed together.
  • 20. Tips Because ExtJs's layout is nested, so see the raw design start from bigger (base) component.
  • 21. Exersice Please make layout for this mockup in ExtJs’s ways.
  • 22. Thanks for your attention. Presented by : Irfan Maulana Contact me on : Email : mazipanneh@gmail.com Blog : www.mazipanneh.wordpress.com