CodeIgniter data grid generation using PCG

Using GRID action in PCG you can generate data grids for managing data in table(module). Generating code for data grid using PCG is easy and also the further customization on the generated code is easy since you get a JavaScript Knockout model.

This tutorial is about generating code for data grid for managing data in any database table using PCG. PCG generated data grid code uses the following technologies.

  • CodeIgniter 3.0 
  • Knockout 3.2
  • Twitter Bootstrap 3

Generating data grid using PCG

Please follow the below steps for creating a datagrid using PHP Code Generator.

  1. Please go to Add website by clicking here or by clicking the link in My Websites page under PHP Code Generator menu
  2. Complete all the fields there and submit for going to the PCG design page
  3. Create a new module with your table name and add fields for each column in the table.
  4. Add one action with any name and select the type as "" in the type dropdown.
  5. Fill all other required fields in the action form
    1. Add the fields to be updated/shown in the grid under fields section
    2. Add the fields to be searched when type in top search box in the generated grid view
    3. Add filters based on field value if only want to display subset of data from the data
  6. Save the changes and click on the Deploy button for generating and deploying the code to the test server
  7. If something to be corrected you can always come back to design and overwrite the demo deployment for testing new changes
  8. After completing everything you could download the code from My Websites by clicking on the download link. 

A data grid generated using PCG

 

 

Advantages of using PCG generated data grid than using libraries

  • You don't need to write the code manually, but generate complete website using wizard, with integrated security, data validation and lot of additional features.
  • When using a library for generating the data grid at runtime for a given table, it consume lot of resource for identifying the data structure then generating the code on the fly. When using PCG the code is generated for the given data structure and saved and runtime only the execution of the code happens not identifying the table structure.
  • It is easy to customize the generated code, because the code is well organized in CodeIgniter 3.0 MVC pattern and dedicated JavaScript knockout model files are generated for each table. So further customization is easy such as adding custom validations.

 

Generate your website

Do you know that the PHP Code Generator can generate PHP websites in minutes in CodeIgniter 3?

Learn more about our PHP Code Generator and generate your web applications using PCG with functioning admin portal.

Connect with Google or Facebook and generate your next CodeIgniter website in minutes with plenty of features like searching with pagination, AJAX based grid data editors, group based security and admin portal etc.