PHPackages                             fgsl/eyedatagrid - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. fgsl/eyedatagrid

ActiveDatagrid

fgsl/eyedatagrid
================

Display data from a database in a sortable table

1.0.1(8y ago)4194BSD-2-ClausePHPPHP ^5.6 || ^7.0

Since Apr 12Pushed 5y ago1 watchersCompare

[ Source](https://github.com/fgsl/eyedatagrid)[ Packagist](https://packagist.org/packages/fgsl/eyedatagrid)[ Docs](https://github.com/fgsl/eyedatagrid)[ RSS](/packages/fgsl-eyedatagrid/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

EyeDataGrid
===========

[](#eyedatagrid)

*Based on version 1.0 of class created by Mike Frank  *Former source code:

This component was built because former EyeDataGrid has not update since 2008 and presents fatal errors in current PHP environments.

About
-----

[](#about)

This class can be used to display data from an SQL database in a sortable HTML table. It can execute a given SQL query and generate HTML and Javascript to display the data in an HTML table. The table listing can be sorted by clicking on the column header titles. Data grid tables can also be displayed using Ajax. Its creator, Mike, was not satisfied with available PHP data grid controls. He uses data grids on every web site that he developes. According him, they're great for displaying all kinds of data. He argues that developed his datagrid to suit all his needs and more.

Features
--------

[](#features)

- Filtering and searching capabilities
- Ability to change column headers
- Capable of displaying images
- Automatic row paging
- Row selection
- Supports MySQL database
- Hide columns
- Sort columns
- Customizable look and feel through CSS
- Can handle large data sets
- Ability to add controls
- Checkbox support
- Specify column format types (such as percent, dollars, etc)
- Much more...

Files
-----

[](#files)

**Eyedatagrid.php**

The main datagrid class

**EyeMySQLAdap..php**

Mysql wrapper class created by Mike in former project - an improvement is replacing it with another one

**ex*.php*\* -Example datagrid

Create a file local.php in config folder from local.inc.php template and fill with database access parameters.

**ex*.png*\*

Image of the example

**sample data.sql**

Sample data for playing around with (from examples).

Create a database from this script for running samples.

**table.css**

```
-The style layout for the datagrid table

```

Placeholder Variables
---------------------

[](#placeholder-variables)

What is a placeholder in the datagrid control?

- A placeholder is a just the same as a variable. It is a name and references a column in a particular row.
- For exampe; lets say you had a Pets table with PetName, PetAge and PetComment columns.
- You can reference other columns in the PetComment by placing percent symbols (%) around the column name you are specifying.
- If the primary key is set during the setQuery method, you can use %\_P% as a placeholder for the table's primary key. Where can I use this?
- This can be on the database or scripted.
- This can be used in column types criteria and criteria\_2 param. Look below on TYPE\_IMAGE and TYPE\_CUSTOM for more examples.

Column Types and Usage
----------------------

[](#column-types-and-usage)

A quick overview of the available column types.

**TYPE\_ONCLICK**

Sets a "onclick" call on a cell value.

e.g:

`$db->setColumnType('FirstName', EyeDataGrid::TYPE_ONCLICK, "alert('Hello?')");`

**TYPE\_HREF**

Sets a href link on a cell value.

e.g:

`$db->setColumnType('FirstName', EyeDataGrid::TYPE_HREF, "http://www.google.com");`

**TYPE\_DATE**

Format a date.

e.g:

```
$db->setColumnType('Birthday', EyeDataGrid::TYPE_DATE, "M d, Y", true); // Converts to a timestamp and then to the formatted date
$db->setColumnType('Birthday', EyeDataGrid::TYPE_DATE, "M d, Y"); // Converts formatted date from a timestamp
```

**TYPE\_IMAGE**

Changes a column's values to a image.

e.g:

```
$db->setColumnType('Photo', EyeDataGrid::TYPE_IMAGE, "/images/photos/%LastName%.png");
```

**TYPE\_ARRAY**

Maps a value to a key in an array

```
$db->setColumnType('Gender', EyeDataGrid::TYPE_ARRAY, array('f' => 'Female', 'm' => 'Male'));
```

**TYPE\_CHECK**

Converts a cell to a checkmark when the value is "1", "true", "yes" or value matches 3rd passed value.

e.g:

```
$db->setColumnType('Single?', EyeDataGrid::TYPE_CHECK);
$db->setColumnType('Single?', EyeDataGrid::TYPE_CHECK, 'legs');
```

**TYPE\_PERCENT**

Converts a value to a percent as a whole number.

e.g:

```
$db->setColumnType('Score', EyeDataGrid::TYPE_PERCENT); // Value is already in percent
$db->setColumnType('Score', EyeDataGrid::TYPE_PERCENT, true); // Value is converted from decimal format when 3rd param is true
$db->setColumnType('Score', EyeDataGrid::TYPE_PERCENT, true, array('Back' => 'red', 'Fore' => 'black')); // Adds bars whose width represents the percent, colors are specified as 'Back' and 'Fore'
```

**TYPE\_DOLLAR**

Converts a value to the a currency. Always rounded to 2 decimal places.

e.g:

```
$db->setColumnType('Price', EyeDataGrid::TYPE_DOLLAR);`
```

**TYPE\_CUSTOM**

Convert value to a custom value.

e.g:

```
$db->setColumnType('School', EyeDataGrid::TYPE_CUSTOM, 'I go to %CollegeName% in %City%, %Province%'); // Converts a cell to "I go to..". Placeholders are replaced with the value in that row's column
```

**TYPE\_FUNCTION**

Sends a value (or values) to a user specified function.

e.g:

```
$db->setColumnType('Password', EyeDataGrid::TYPE_FUNCTION, 'md5', '%Password%'); // Value is sent to the md5 function and return is printed in the cell
$db->setColumnType('Password', EyeDataGrid::TYPE_FUNCTION, 'make_hash', '%Password%'); // Value is sent to the make_hash user function and return is printed in the cell
$db->setColumnType('Password', EyeDataGrid::TYPE_FUNCTION, 'generate_key', array('%Username%', '%Password%')); // To pass multiple params to the user function use an array
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2949d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2cb6d4497d6c4358a5c7e7e31d34412f5d6e9617aafa487b125bcc870171cd1e?d=identicon)[fgsl](/maintainers/fgsl)

---

Top Contributors

[![fgsl](https://avatars.githubusercontent.com/u/128915?v=4)](https://github.com/fgsl "fgsl (3 commits)")[![fholzer](https://avatars.githubusercontent.com/u/1814883?v=4)](https://github.com/fholzer "fholzer (1 commits)")

---

Tags

datagridtable

### Embed Badge

![Health badge](/badges/fgsl-eyedatagrid/health.svg)

```
[![Health](https://phpackages.com/badges/fgsl-eyedatagrid/health.svg)](https://phpackages.com/packages/fgsl-eyedatagrid)
```

###  Alternatives

[ublaboo/datagrid

DataGrid for Nette Framework: filtering, sorting, pagination, tree view, table view, translator, etc

2971.9M23](/packages/ublaboo-datagrid)[nicolaskruchten/pivottable

Javascript Pivot Table (aka Pivot Grid, Pivot Chart, Cross-Tab) implementation with drag'n'drop.

4.4k202.9k1](/packages/nicolaskruchten-pivottable)[anourvalar/office

Generate documents from existing Excel &amp; Word templates | Export tables to Excel (Grids)

24085.2k](/packages/anourvalar-office)[o5/grido

Grido - DataGrid for Nette Framework

87290.5k4](/packages/o5-grido)[nagarajanchinnasamy/subtotal

Subtotal.js is a JavaScript plugin for PivotTable.js. It renders subtotals of rows and columns with the ability to expand and collapse rows.

93130.1k](/packages/nagarajanchinnasamy-subtotal)[mmucklo/grid-bundle

Datagrid for symfony2 or symfony3 or symfony4 or symfony5

21343.7k3](/packages/mmucklo-grid-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
