Error dialog when no error

QuestionsError dialog when no error
Simon asked 10 years ago

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

5 Answers
Abu Ghufran answered 10 years ago

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

Abu Ghufran answered 10 years ago

You can echo the output of render() function to desired location in html.

Simon answered 10 years ago

$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?

Simon answered 10 years ago

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

Simon answered 10 years ago

Fixed- I had left couple of css links in the file. Removed them and fixed!

Your Answer

9 + 11 =

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?