NetTuts.com: Build Ajax Data Grids with CodeIgniter and jQuery
Note: This article was originally published at PHPDeveloper on 23 September 2011.
In this lesson, we will create a CodeIgniter library that allows us to generate data grids automatically for managing any database table. I'll explain each step required to create this class; so you'll likely learn some new OOP techniques/concepts in the process! As a bonus, we'll proceed to write some jQuery code that will enable a user to update the data grid's content without having to wait for a page refresh.
The tutorial's broken up into a few different steps, each complete with descriptions and plenty of code ready for cut-and-paste:
- Build a Data Grid Generator Class (a helper in PHP)
- Testing the Datagrid Helper Class with a CodeIgniter Controller
- Implementing Ajax (jQuery to the Rescue!)
- Check All or Nothing!
You can also download the source for all of the scripts if you'd like to dive right into the code.