Custom on_insert not working for inline add

QuestionsCustom on_insert not working for inline add
Jeremy asked 7 years ago

I have a grid with a query that joins 3 tables. I have a custom on_insert which successfully adds all the new data to the tables. However, when the grid comes back, the new row has an ID of jqg1 and of course, any subsequent actions to that row generate an error (since the queries use 'jqg1' as an ID and that is not valid).

Note that the '+' sign for inline add is greyed out when the grid comes back. If I refresh the page, the new row is listed and all the data are there. If I add another row, then the ID will be jqg2.

How can I fix this problem? Is there supposed to be a callback from my custom on_insert method to set the ID?

1 Answers
Jeremy answered 7 years ago

Ok – solved. I searched thru here again (third charming time) and found that I need to put

$res = array("id" => $id, "success" => true);
echo json_encode($res);

at the end of my custom insert.

Your Answer

10 + 14 =

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?