O'Reilly logo

Ext JS 4 Web Application Development Cookbook by Stuart Ashworth, Andrew Duncan

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

Populating a form from a selected grid row

Binding grid data to other components provides a useful way to display data differently or enable users to edit the data away from the grid. This recipe will demonstrate how to bind a grid to a form, update the record, and have the grid reflect the changes.

Getting ready

We are going to use the Invoice example that we have used throughout this chapter. So we will start by including the Model and Store files to our HTML page:

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

How to do it...

  1. Create a grid bound to the invoiceStore with the following column configuration:
    var grid = Ext.create('Ext.grid.Panel', { title: 'Chapter ...

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