O'Reilly logo

Sencha MVC Architecture by Ajit Kumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Why Sencha MVC architecture

Now that we understand the need of having MVC architecture on the client side, let us see why the Sencha MVC architecture was introduced as part of the Sencha Ext JS and Touch frameworks.

Let us look at the following code, written using Ext JS, which shows the list of users (from a users.json file) and shows an Edit User window with a form, populated with the selected record detail, when an entry in the list is double-clicked:

Ext.onReady(function() { //Define the user model Ext.define('User', { extend : 'Ext.data.Model', fields : [ 'id', 'name', 'email'], }); //Define the Users store, which uses the User as the model //and loads models from the users.json file Ext.define('Users', { extend : 'Ext.data.Store', model : ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required