concept grid panel in category ext js

appears as: grid pel, grid pel, The grid pel, grid pels, grid panel, grid pels
Ext JS in Action, Second Edition

This is an excerpt from Manning's book Ext JS in Action, Second Edition.

The Sencha development team literally worked night and day on features like the grid panel, and the results show, especially after taking a good look at what’s changed since Ext JS 3.0.

Features new to the grid panel include what’s known as the infinite grid, which allows you to paginate through large datasets without having to include a paging toolbar. Other new features include a reorganization of the namespace for better grouping of classes (see figure 1.17).

Since the early days of Ext JS the grid panel has been the centerpiece of the framework. In many respects this holds true today, and the grid panel is arguably one of the widgets with the most advanced functionality available in Ext JS, allowing for rapid data entry in a tabular form. When you use the grid panel, you gain the ability to visualize and manipulate large datasets in an intuitive way, so this class should fit into most enterprise and office applications. Note that the grid has seen a major overhaul of performance in Ext JS 4.1, and it’s now so fast that the list view from previous releases of Ext JS is no longer needed.

This chapter focuses on the grid panel and builds on what you learned about data stores in the previous chapter. You’ll start by constructing a grid panel that feeds from a store that reads local in-memory array data. After exploring the basics, you’ll move on to advanced features like paging and scrolling. Finally, you’ll learn how to edit and interact with data using the data store from the grid panel and the CRUD actions covered in the last chapter.

At each step of the process you’ll learn more about the grid panel and its supporting classes. But before we start, we’ll introduce you to the grid panel.

The key supporting classes driving the grid panel are grid.View, SelectionModel, and Store. Let’s take a quick glance at an implementation of a grid panel and see how each class plays a role in making the grid panel work (figure 8.2).

Figure 8.2. The grid panel’s supporting classes: grid.View, SelectionModel, and Store

In figure 8.2, you see a grid panel with its supporting classes highlighted. Starting from the beginning, the data source, you see the Store class. Data stores work by using a reader, which is used to “map” data points from a data source and populate the data store. They can be used to read array, XML, or JSON data via the array, XML, and JSON readers. When the reader parses data, it’s organized into records, which are organized and stored inside the data store.

8.1. Introducing the grid panel

At first glance, the grid panel may look like a glorified HTML table, which has been used for ages to display data. If you take a moment to look at one of the Ext JS grid examples, you’ll realize that this is no ordinary HTML table. You can see one example implementation of the grid panel that uses an array store at http://mng.bz/HAcK (see figure 8.1).