7. Ext JS Tutoral - Advanced Grid
Last updated Apr 12th, 2019 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$287 per month—let's make that $500!
Learn moreExt JS can save us time by handling formatting of tables. But an Ext JS Grid is more than a simple table: they can include sortable columns and they can paginate long result sets or let the users select rows. Ext JS Grids do a lot of stuff that a basic HTML table does not. So how do we make one?
An Ext JS Grid typically needs 2 pages:
- A page to display the grid (this is the obvious page you were already thinking of)
- A dynamic PHP page to query the data that populates the table (called a "store")
The Grid Page¶
This can be a simple HTML page. In our example here, we're putting this alongside the MODX index.php in your docroot. Just like all the examples before, we include the Ext JS CSS and Javascript.
The Store¶
This is a PHP file or a Snippet – here we're putting this alongside your MODX index.php file, so we have to add a few extra lines to gain access to the $modx object. Normally this code would be in a Snippet or in a CMP, so you'd already have access to the $modx object.
You can view the store.php in a browser and you should see some JSON data. If you're trying to see what's being posted to this file from the grid page, use the MODX log function to log the posted data.
See Also¶
- http://dev.sencha.com/deploy/ext-3.4.0/examples/grid/paging.html
- http://sottwell.pogwatch.com/datagrid-1.html
- http://sottwell.pogwatch.com/datagrid-2.html
- http://sottwell.pogwatch.com/datagrid-3.html
- Ext JS Tutorial - Message Boxes
- Ext JS Tutorial - Ajax Include
- Ext JS Tutorial - Animation
- Ext JS Tutorial - Manipulating Nodes
- Ext JS Tutorial - Panels
- Ext JS Tutoral - Advanced Grid
- Ext JS Tutorial - Inside a CMP
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$287 per month—let's make that $500!
Learn more