Error Show Datagridview

QuestionsError Show Datagridview
BuiDuongThe asked 10 years ago

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

1 Answers
Abu Ghufran answered 10 years ago

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>

Your Answer

4 + 18 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?