I have just started using this grid and I'm very close, however I get the grid in the page but no rows. The row data has appeared in the 'error' dialog (info_dialog) but with the header and menu information as the standard page. Like a page within a page.
$title = "Manage Competency Groups";
$breadcrumbs = $title;
include_once("grid/config.php");
include 'header.php';
include 'menu.php';
mysql_connect(memSERVER,memUSER,memPASSWORD);
mysql_select_db(PHPGRID_DBNAME);
include(PHPGRID_LIBPATH."/inc/jqgrid_dist.php");
$g = new jqgrid();
//$g->debug = 0;
// set few params
$grid["caption"] = "Competency Groups";
$g->set_options($grid);
// set database table for CRUD operations
//$g->table = "CompetencyGroups";
//$g->table = "Competency";
$g->select_command = "SELECT ID, `Group`, Note from CompetencyGroups";
// pass the cooked columns to grid
$g->set_columns($cols);
$content = "<div id='content-leftmenu'>";
$content .= "<h1>$title</h1><p>";
$content .= $g->render("list1");
//$content .= "<font color=red>$errormsg</font>";
$content .= "</div>";
echo $content;
} // …can manage
Make sure, you call '$g->render();' function before any HTML is rendered
(echo'd) to output, as it expect exact JSON format for ajax calls
$out = $g->render("test");
$content = "<div id='content-leftmenu'>";
$content .= "<h1>$title</h1><p>";
$content .= $out;
echo $content;
However I have two include lines for menu and header – does that mean I need to move them? If so where to?
Tweaked again. I still get error message but it only contains the data?
{"page":"1","total":1,"records":"5","rows":[{"ID":"1","Group":"Search Technician","Note":""},{"ID":"2","Group":"Team Leader","Note":""},{"ID":"3","Group":"Search Manager","Note":""},{"ID":"4","Group":"Search Planner","Note":""},{"ID":"5","Group":"Search Operations","Note":""}]}
Clearly something still wrong