Master ID

QuestionsMaster ID
Georges asked 1 week ago

Hi Abu,

I have a master/detail form

in Master I have an ID named IDE

I would like to record this IDE in my detail record

with subgridparams, it’s ok in SQL SELECT

$iddoc = $_GET[“IDE”]

and in select  * where ID = IDE, it’s correct

more, I would like to fill this IDE in my detail record

but with:

$col[“editoptions”] = array(“defaultValue”=>$iddoc);

it doesn’t work.

what is wrong ?

regards

 

1 Answers
Abu answered 1 week ago

Hello,

 

Refer this demo:

https://www.gridphp.com/demo/demos/master-detail/master-detail.php

and code (line 91): This will load client name in detail grid in add dialog. You can have similar code with edit_options for edit dialog.

https://www.gridphp.com/demo/demos/master-detail/master-detail.phps

// fill detail grid add dialog with master grid id
$opt["add_options"]["afterShowForm"] = 'function(frm) {
var selr = jQuery("#list1").jqGrid("getGridParam","selrow");
var n = jQuery("#list1").jqGrid("getCell",selr,"name");
jQuery("#client_id",frm).val( n )

}’;

Your Answer

8 + 17 =

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?