Hello Abu,
How to call the "Edit Form dialog" overside grid (like rowactions)?
Regards,
Davor
Hi,
You can replace the Edit link functionality from jqgrid_dist.php file.
if ($this->actions["edit"] !== false)
$act_links[] = "<a title="Edit this row" href="javascript:void(0);" onclick="jQuery(this).dblclick();">Edit</a>";
Instead of jQuery(this).dblclick(); you can have
jQuery(this).jqGrid('editGridRow', cl); // where cl is row id.
Reference FAQ:
Q) How to show "Edit Record" dialog on row double click?
Following code snippet will enable edit dialog on row double click. This will be placed in before we echo $out variable.
<script>
var opts = {
'ondblClickRow': function (id) {
var rowid = jQuery(this).jqGrid('getGridParam','selrow'); // returns null if no row is selected (single row)
jQuery(this).jqGrid('editGridRow', rowid);
}
};
</script>
…
<div style="margin:10px">
<?php echo $out?>
</div>
Hello Abu,
This with a double click is extremely useful option but I noticed one problem.
So when you first load the grid (and double-click on the row) "edit form" is not displayed correctly (lists the field that should not be and ignores the size of the form).
As it ignores some parameters like:
$col["show"] = array("list"=>true, "add"=>true, "edit"=>false, "view"=>true);
$grid["edit_options"] = array("recreateForm" => true, "closeAfterEdit"=>true, 'width'=>'550', 'top'=>'90', 'left'=>'100');
…
If you then click on the classic "edit button" things get better. Following the double-click is working properly.
Can I get instructions on how to solve this?
Best regards,
Davor
All you need to fix is to add edit param as 3rd argument.
jQuery(this).jqGrid('editGridRow', rowid, <?php echo json_encode_jsfunc($g->options["edit_options"])?>);
Where $g is jqgrid() object.
I made a php function alone query and function I created will use to phpgridnya.saya not understand where do I call the function I created earlier plan to put it to continue to the next one field where I display the field'm valuenya example
Hello Wain,
Your question is unclear. Please send your query with screenshot at [email protected].
Thanks