Forum
15:27
31/12/2008
I checked the documentation and forums and I don't think there is a way to set a default value for a dropdown.
For example, when adding a new record, my users would like the dropdown values to default to the values used for the last record entered. I think now the only way to accomplish this is to dynamically reorder the editoptions when the page is loaded, putting the "default" selected item at the top of the list.
Please correct me if I am wrong!
08:54
Moderators
30/10/2007
Hello,
You are right - there is no default value. In jqGrid this is the first one, but you can use with succes beforeShowForm when in add mode to set the default value of the select
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.
14:59
31/12/2008
ROCK ON. I was able to get it to work by doing something like this. I will later swap out the hard coded value to a dynamic value that is pulled from the most recent grid record. Thanks for the tip!!
.navGrid('#pager2',{
edit:true,del:true,add:true,search:true
}, {height: 250, width: 400, reloadAfterSubmit: true, modal: true, checkInput: true}, // edit options
{height: 250, width: 400, beforeShowForm:function(){
jQuery("#practice").val("BREO");
}}, // add options
{}, // del options
{} // search options
)
Most Users Ever Online: 715
Currently Online:
64 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