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

Custom rendering of grid cells with TemplateColumns


The Ext.grid.column.Template class is a new column type that has been introduced in Ext JS 4. It allows a very easy mechanism for formatting a grid's columns with an Ext.XTemplate so you can have full control over your grid's displayed data.

We will continue with our Invoice Management example, and in this recipe we are going to explore how to use this new class to add extra information and formatting to the Client and Amount grid columns.

Getting ready

As with all the recipes in this chapter so far, we are going to use the generic Invoices Ext.data.Model and Ext.data.Store, which can be found in the invoices-store.js and invoices-model.js. These have been bundled with the resources for this chapter and both files will need to be included in your HTML like so:

<script type="text/javascript" src="invoices-model.js">
</script>
<script type=—text/javascript— src=—invoices-store.js—>
</script>

How to do it...

  1. Now we have the...