Dear phpgrid
Im have error show Datagridview (connect data successfull)
Help Fix error
http://i661.photobucket.com/albums/uu332/buiduongthe/Error.png
index.php
{
include("modules/DeviceMonitor/index.php")
}
modules/DeviceMonitor/index.php
{
<?php
include("lib/inc/jqgrid_dist.php");
$g = new jqgrid();
$grid["caption"] = "System Monitor";
$g->set_options($grid);
//$g->table = "device_reallog";
$g->select_command = "select id,status from system";
//$g->set_dimension(100,180);
//$g->setGridOptions(array("width"=>''));
//$g->setGridOptions(array("height"=>180));
$out = $g->render("System");
?>
<link rel="stylesheet" type="text/css" media="screen" href="lib/js/themes/redmond/jquery-ui.custom.css"></link>
<link rel="stylesheet" type="text/css" media="screen" href="lib/js/jqgrid/css/ui.jqgrid.css"></link>
<script src="lib/js/jquery.min.js" type="text/javascript"></script>
<script src="lib/js/jqgrid/js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="lib/js/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="lib/js/themes/jquery-ui.custom.min.js" type="text/javascript"></script>
<?php echo $out?>
}
thanks
Hello,
The image is not opening correctly, but i am sending you possible resolution.
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
Easy solution would be to break the code in 2 parts.
PHP PART
include("inc/jqgrid_dist.php");
$g = new jqgrid();
…
$out = $g->render("list1");
VIEW PART
<html>
<link rel="stylesheet" type="text/css" media="screen" href="js/themes/redmond/jquery-ui.custom.css"></link>
<link rel="stylesheet" type="text/css" media="screen" href="js/jqgrid/css/ui.jqgrid.css"></link>
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/jqgrid/js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="js/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="js/themes/jquery-ui.custom.min.js" type="text/javascript"></script>
<div style="margin:10px">
<?php echo $out?>
</div>
…