Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jqGrid Custom Edit Dialog

Tags:

jquery

php

jqgrid

I am working to an application that uses jqGrid. The problem is that the edit dialog that should appear at row edit must have a specific layout. So I would prefer to load it via ajax and then send the data back to jqGrid manually. I searched a lot on the forums but I could not find an example of how to do it.

So, I just need jqGrid to fill the edit dialog pop-up with custom content from a PHP script.

UPDATE: THe idea is that I have a form generator, where the user sets the position/width/heigh/visibility of the edit fields... and this must be used in the edit dialog.

like image 940
Andrei Avatar asked Sep 28 '10 07:09

Andrei


1 Answers

You can use editfunc or addfunc option of the navGrid. If for example editfunc are defined then instead of editGridRow jqGrid will be called editfunc with the id of selected row as the parameter.

Alternative you can use custom button (see this answer as an example).

To modify data in the table after ther custom edit dialog you can use setRowData function.

UPDATED: If you need just make some modification of layout of the edit dialog you can use beforeShowForm for th modifications.

like image 59
Oleg Avatar answered Sep 20 '22 15:09

Oleg