Error dialog when no error

QuestionsError dialog when no error
Simon asked 5 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 'header.php';
include 'menu.php';


$g = new jqgrid();
//$g->debug = 0;

// set few params
$grid["caption"] = "Competency Groups";

// 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

$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 5 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 5 years ago

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

Simon answered 5 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 5 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 5 years ago

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

Your Answer

13 + 19 =

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 / 5. Vote count:

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

Let us improve this post!