hi sir ,add form is not closing for some pages.i get the error like this while debugging
Uncaught SyntaxError: JSON.parse: unexpected end of data at line 3 column 5 of the JSON data after submit
Hello,
If you see browser debugger ajax response, it will tell the ajax response showing error details.
This also comes if using event handler:
if you make it 3rd param to false, then it should return json data
e.g. $e[“on_insert”] = array(“add_client”, null, false);
$e[“on_insert”] = array(“add_client”, null, false);
$grid->set_events($e);
function add_client($data)
{
// …..
$insert_id = $grid->execute_query($sql,false,”insert_id”);
if (intval($insert_id)>0)
$res = array(“id” => $insert_id, “success” => true);
else
$res = array(“id” => 0, “success” => false);
echo json_encode($res);
die;
}