I’ve workarea with some jqgrid with a complex system of alert dialog. I’ve a problem about addForm z-index which I can’t change dinamically as the others dialog.
I’ve a variable
increaseZIndex = 2000;
which I increase dinamically at each dialog creation:
increaseZIndex++;
But only in the addForm zIndex properties, this value doesn’t change. I suppose the add Form dialog of the grid is created once and then it’s only hidden and not been created as new at each new insert.
Here’s the code:
jQuery("#mygrid").jqGrid('navGrid','#pmygrid', {edit:false,add:true,del:false,search:false,refresh:false}, //options
{zIndex:1500,recreateForm:true}, // edit options
{zIndex:(increaseZIndex++),height:280,recreateForm:true, reloadAfterSubmit:true,url:"/myUrl.do",
and so on…
How can I force this value to change dinamically as the others? Thanks!
First of all you should include
recreateForm: truefor both Add and Edit options. In the case the Add and Edit dialogs will be new created instead of making hidden/shown.In all my projects I change
recreateForm: trueas the default setting by setting of the properties of$.jgrid.edit(see the answer or another one for the corresponding code examples).