47. 47
sencha generate package -require Home
then generate package -require Office
then generate package -require Organization
then generate package -require Person
then generate package -require History
60. Nils Dehl
• JavaScript Consultant and Trainer
• over 10 years Ext JS experience
• Sencha MVP
• @nilsdehl
• nils.dehl@dkd.de
• https://github.com/mrsunshine
60
Notes de l'éditeur
Routing
Packages
dynamic package loading
Who is using routing?
Single Page Applications
no Page loads
no History
Back Button leaves app
Example app Coworkee based on Sencha, extend, on GitHub
Track app state
bookmark / email
make app stateful
open specific state view of an SPA app
routing should not be used to store any data or session
Fragment Identifier
control the history stack of the browser without reloading the current page
history stack of an SPA
back and forward button working
the ext router
lets look how routing works
start with the login route
action
file Path on slide in the footer
slides will be shared
replace When set to true, this will replace the current resource in the history stack with the hash being set.
force Even if the hash will not change, setting this to true will force the Ext.route.Router to react.
defaultToken
default route #home
routes with params
load a person
see url in footer
before
un matched route
onRouteChange Event
add search filter to route
control add listener “routechange”
Multi route
Pipe |
wildcard
Ext.History.getToken()
Share code between applications
reusability
structure
sharing (Package Repository / Github )
Ext core / themes / fonts / components scheduler or gant/ custom code
who is using?
core
modern / classic
themes
fonts
ux / google
app packages
local
remote
generate package via Sencha CMD
theme
require
uses
require other packages / dependencies
inside of package folder
local repo init
host repo on http get
example nexus
add to local repo
from build folder
reduce initial load size for big apps
Load on demand
user rights
who is using?