Results 1 to 4 of 4

Thread: Newbie question on ext.application and ext.onready

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    3

    Default Answered: Newbie question on ext.application and ext.onready

    Absolute beginner here, trying to start with ext.js. Hard to find some overview of the steps to take for creating a simple application.
    Want to create a simple address manager application with basic crud operations that opens with a list view of the addresses and has add/edit/delete buttons on a toolbar. The add/edit options should popup an edit form with the proper input fields.
    Could someone explain me when to use Ext.appplication and when to use ext.onReady? And when should I use Ext.container.Viewport?

    option 1, using ext.application

    Ext.application({
    name: 'HelloExt',
    launch: function() {
    Ext.create('Ext.container.Viewport', {
    layout: 'fit',
    items: [
    {
    title: 'Hello Ext',
    html : 'Hello! Welcome to Ext JS.'
    }
    ]
    });
    }
    });


    Option 2; using Ext.onReady

    Ext.onReady(
    function() {
    Ext.create('Ext.container.Viewport', {
    layout: 'fit',
    items: [
    {
    title: 'Hello Ext',
    html : 'Hello! Welcome to Ext JS.'
    }
    ]
    });
    }
    );

  2. 1) If you're using MVC, use launch, if not, use onReady

    2) The viewport fills the whole screen automatically, so use that if your page will take up the whole page.

  3. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256
    Answers
    759

    Default

    1) If you're using MVC, use launch, if not, use onReady

    2) The viewport fills the whole screen automatically, so use that if your page will take up the whole page.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  4. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    3

    Default

    Thanks, that clears things up. One last question. in option 1 I use ext.application, in option 2 I do not use it. And in both cases it works.
    When should I use ext.application?

  5. #4
    Sencha User
    Join Date
    Jun 2012
    Posts
    3

    Default

    Forget my provious question, it's clear now.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •