I don't understand how to change width of edit form in JqGrid. I found option 'width' but I don't know how to use it (there isn't example).
Asked
Active
Viewed 2.0k times
2 Answers
26
You probably know the method navGrid. It has parameters in the form
$("#list").jqGrid('navGrid','#pager',{parameters},
prmEdit, prmAdd, prmDel, prmSearch, prmView);
where the parameter prmEdit
can contain any options of editGridRow method inclusive the width option which you need. So if you need for example to have edit form with 500px width instead of default 300px you can use
$("#list").jqGrid('navGrid','#pager',{},{width:500});
To simplify you the implementation I modified an example from my another answer so that the edit dialog has 200px: see it live here.

Oleg
- 220,925
- 34
- 403
- 798
-
@peter: You welcome! Because you are relatively new at the stackoverflow.com consider to use voting up the answers or questions (see http://stackoverflow.com/faq#howtoask) and accepting one from the answers (see http://meta.stackexchange.com/questions/5234) or both (voting up and accepting). This will the standard way to say "tanks" and it helps another people quickly to find the most helpful answer. – Oleg Oct 10 '10 at 21:47
-
@jessica: You welcome! I find also many places of the documentation writen in the wrong way. One describes parameters of the function `editGridRow` and 99% of the users should use the settings just as `prmEdit` and `prmAdd` parameters of `navGrid`. It is difficult to understand. jqGrid has wiki documentation and everybody, also you, can change the documentation. I also wanted to do this, but didn't found the time for this till now. – Oleg Jan 22 '11 at 10:41
-
also `width:'500px'` will not work, you have to put `width:500` – Chtioui Malek Jul 04 '13 at 10:12
-
1@ChtiwiMalek: Sorry, but I don't understand your comment. Where in the code you could see `width:'500px'` in my code? `width` should be integer. If one use non-numeric value then jqGrid use `width: "auto"` instead. – Oleg Jul 04 '13 at 12:10
-
@Oleg: your code is correct. just saying that the value should be numeric not a string. – Chtioui Malek Jul 04 '13 at 12:46
3
you can change in edit settings by using the following code.
editSettings = {
recreateForm:true,
jqModal:false,
reloadAfterSubmit:false,
closeOnEscape:true,
savekey: [true,13],
closeAfterEdit:true,
zIndex:1000,
**width: 450**,
pgbuttons:false,
.jqGrid('navGrid','#Pager',editSettings,...)

Kishore Kumar
- 909
- 2
- 10
- 15