Datagrid is not visible except the header and footer
It’s a common issue that datagrid seems to render, but only the header and footer are displayed. There is no data displayed in the grid.
- The first thing to look at is to check if the PHP session is enabled. Run
phpinfo()
and see if thesession.save_path
was set to a valid path. In most cases, this is the issue. - Following above, also make sure session.auto_start must be set to "1"
- If the first step doesn't resolve the issue, check if
SERVER_ROOT
has been set correctly. See installation article for details for how to set server root in conf.php. - If the first two all look fine. Here's what you can do next. In Firefox browser use Firebug (Press F12) to view the ajax response returned from "
data.php
". Likely there's an error occurred on the server during Ajax call. - As pointed out by a few users, some HTML editors adds a new line before the beginning
<?php
tag in the config.php file. Apache web server has issues with it. Try to use a different HTML editor like Notepadd++ to avoid this kind of issue. When using Notepad++, make sure the encoding is set to UTF-8 without BOM. - phpGrid uses the default PHP session name. If you get a similar error message such as the following:
Notice: Undefined index: _oPHPGRID_tablename_sql in /home/www/phpGrid/data.php(1) : eval()'d code on line 1
, you will need to declare your custom session name in conf.php - Including multiple jQuery can cause issue. phpGrid includes its own version of jQuery 3. Some framework includes jQuery that could create conflicts.
- Check the parameters in the constructor are all set correctly. It needs ALL three parameters to work:
- the sql statement,
- primary key,
- and table name
- Update (Windows users):
Microsoft IIS web server sometimes displays a generic 500 internal error message. You must change the IIS settings to display server error in details with the following steps:
Error Pages -> 500 -> Edit Feature Settings -> "Detailed Errors"
https://phpgrid.com/wp-content/uploads/2017/09/iis-500-error.jpg
If you are using IE, be sure to also uncheck "Show friendly HTTP error messages" in Internet Options:
http://phpgrid.com/wp-content/uploads/2017/09/IE-disable-friendly-error-message.png