Book Image

Ext JS 4 Web Application Development Cookbook

By : Andrew Duncan, Stuart Ashworth
Book Image

Ext JS 4 Web Application Development Cookbook

By: Andrew Duncan, Stuart Ashworth

Overview of this book

<p>Ext JS 4 is Sencha’s latest JavaScript framework for developing cross-platform web applications. Built upon web standards, Ext JS provides a comprehensive library of user interface widgets and data manipulation classes to turbo-charge your application’s development. Ext JS 4 builds on Ext JS 3, introducing a number of new widgets and features including the popular MVC architecture, easily customisable themes and plugin-free charting. <br /><br /><em>Ext JS 4 Web Application Development Cookbook</em> works through the framework from the fundamentals to advanced features and application design. More than 130 detailed and practical recipes demonstrate all of the key widgets and features the framework has to offer. With this book, and the Ext JS framework, learn how to develop truly interactive and responsive web applications.<br /><br />Starting with the framework fundamentals, you will work through all of the widgets and features the framework has to offer, finishing with extensive coverage of application design and code structure.<br /><br />Over 110 practical and detailed recipes describe how to create and work with forms, grids, data views, and charts. You will also learn about the best practices for structuring and designing your application and how to deal with storing and manipulating data. The cookbook structure is such that you may read the recipes in any order.<br /><br />The <em>Ext JS 4 Web Application Development Cookbook</em> will provide you with the knowledge to create interactive and responsive web applications, using real life examples.</p>
Table of Contents (19 chapters)
Ext JS 4 Web Application Development Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Using a FitLayout to expand components to fill their parent


The FitLayout makes it possible for you to expand a component to fill its parent container. The FitLayout is easy to use and requires no configuration. The screenshot shows how a FitLayout can be used to automatically expand a panel to take up its parent's entire area:

How to do it...

  1. Start by creating a simple Ext.panel.Panel and render it to the document's body. This panel will be the parent item that contains our inner, expanded-to-fit component:

    Ext.create('Ext.panel.Panel', {
        title: 'Fit Layout',
        width: 500,
        height: 200,
        renderTo: Ext.getBody()
    });
  2. Now, add the inner panel by adding it to the parent's items collection:

    Ext.create('Ext.panel.Panel', {
        title: 'Fit Layout',
        width: 500,
        height: 200,
        items: {
            title: 'Inner Panel',
            html: 'Panel content',
            bodyPadding: 10,
            border: true
        },
        renderTo: Ext.getBody()
    });
  3. Finally, apply the fit layout to the parent panel to...