Hi,
I created a master grid order and article as detail grid. I can update and delete article items. But I'm not abled to add a new article. Because order id isn't put in the article add form. I read the demo sample "Master detail" code, but I don't understand where I can put the order.id in article.order_id.
Thanks for your help.
You can use on_insert event and update $_GET["rowid"] which is master grid PK.
e.g.
$e["on_insert"] = array("add_client", null, true);
$grid->set_events($e);
function add_client(&$data)
{
$id = intval($_GET["rowid"]);
$data["params"]["client_id"] = $id;
}
Refer demos/master-detail/master-detail.php
Is there a solution with javascript integration ?
I tried to integrate the on_insert function in my own framework, no way :'(
Ok, it's working with my framework (object). But it's not really good to do it in my way. I added the on insert function in global area outside the object. :'(