Forum


22:33

20/03/2009

Hi,
Quick question which I just can't seem to wrap my head around solving.
I have a combo-box above my grid control that needs to be populated before add/edit/del is clicked in the grid navigation bar.
I need to be able to cancel the load event and post a dialog indicating that they choose a value first. This would be similar to the "Select a row" dialog that occurs now but instead of requiring a row it would require a combo box outside the dialog box to not be null.
Any suggestions on where to do this ? I'm currently using the beforeShowForm event to load a number of selects which depend on the non-grid related select having a non-null value.
Nathan
07:51

Moderators
30/10/2007

Hello,
Not sure, but I think it is better to use navButtonAdd and when the user click the icon for add/edit etc you should analyze the data and do what you want.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
16:17

20/03/2009

Hi Tony, thanks for the post.
How do invoke the form load method with the form automatically created by the colmodel with the parameters listed in the navGrid definition.
Alternatively, is it possible to add a buttonclick event to one of the predefined buttons?
Here's my working example with the conditions checking removed so the code is more readable:
jQuery(grid).navButtonAdd(nav,{buttonimg:"image.gif",caption:"Add",position:"first",title:"Add", onClickButton:function(){
if( CONDITIONS ARE RIGHT){
//Load the form but how ?
}else{
//Open a dialog to tell the user to select the necessary information first.
jQuery(#myDialog).dialog('open);
}
}
});
01:56

Moderators
30/10/2007

Hello,
The same way as it is called in navGrid
if( CONDITIONS ARE RIGHT){
var mygrid = $("#mygridid")
var rowid = mygrid.getGridParam("selrow");
if(rowid) mygrid.editGridRow(rowid, param_for_edit);
}else{
//Open a dialog to tell the user to select the necessary information first.
jQuery(#myDialog).dialog('open);
}
}
});
Also you can use editGridRow as separate method.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
71 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66