Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Ext JS Data-driven Application Design

You're reading from   Ext JS Data-driven Application Design Learn how to build a user-friendly database in Ext JS using data from an existing database with this step-by-step tutorial. Takes you from first principles right through to implementation.

Arrow left icon
Product type Paperback
Published in Dec 2013
Publisher Packt
ISBN-13 9781782165446
Length 162 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Kazuhiro Kotsutsumi Kazuhiro Kotsutsumi
Author Profile Icon Kazuhiro Kotsutsumi
Kazuhiro Kotsutsumi
Arrow right icon
View More author details
Toc

Creating controllers


Now, we will create controllers for our data.

Main

Usually, each view component has a corresponding controller class with the same prefix.

But the first controller we have to deal with is the controller called Main. This controller has already been produced automatically in Sencha Cmd. If we need more processing or logic for the whole application, we should implement this class. Usually, the view class and controller class names match, but this is a special case where they do not because Sencha Cmd generates the Main class. So, it is best to leave it as is and not change the name.

For the app/controller/Main.js code, please see the source file: 09_create_controller\app\controller.

Although we've talked a lot about Main, we are not going to use it for the time being.

Navigation

Now, let's add hrefTarget to the data in the navigation store (source file: 09_create_controller/app/store/Navigation.js).

Ext.define('MyApp.store.Navigation', {
    …
    root: {
        children: [{...
You have been reading a chapter from
Ext JS Data-driven Application Design
Published in: Dec 2013
Publisher: Packt
ISBN-13: 9781782165446
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image