add/edit form is not closing

Questionsadd/edit form is not closing
german asked 4 years ago

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

1 Answers
Abu Ghufran Staff answered 4 years ago

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;
}

 

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

19 + 6 =

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?