Forum


17:36

13/01/2010

Hi
Basically is there a way that when I select a row, I can have a copy button and when that copy button is clicked, a new add modal popup will display with the defaults already selected(values picked up from the already selected row into thew new add modal popup). This will save a tremendous amount of time adding in new records when previous record are nearly identical!
I tried attaching an event onto a button so that when pressed it could do something like this(im using the struts2-jquery plugin):
function copyRow(){
var id = jQuery("#gridName").jqGrid('getGridParam','selrow');
var properties = '{height:500,width:400,reloadAfterSubmit:true,closeAfterAdd:true,afterSubmit:afterAdd,top:1}';
if(id > 0){
jQuery("#gridName").jqGrid('editGridRow', "new", properties);
jQuery("#gridName").jqGrid('GridToForm', id, '#FrmGrid_gridName');
}else{
alert('Please select a row.');
}
}
What happened above was that the text fields got populated, but the dropdown lists failed. I think it could be because the dropdown lists need to execute the call to retrieve the values for the dropdown but obviously this way I did it, didnt work.
If anyone can help me I would appreicate it greatly. If this functionality doesnt exists, it will be a great one to have in the jqgrid functionality!
thanks!
Most Users Ever Online: 715
Currently Online:
62 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