Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Copying an already existing row into the add new modal ..
10/11/2010
17:36
Avatar
ram2010
Member
Members
Forum Posts: 43
Member Since:
13/01/2010
sp_UserOfflineSmall Offline

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!

18/11/2010
16:18
Avatar
ram2010
Member
Members
Forum Posts: 43
Member Since:
13/01/2010
sp_UserOfflineSmall Offline

I seem to be getting somewhere with this.. however I am facing one problem.

The properties I set in

jQuery("#gridName").jqGrid('editGridRow', "new", properties);

 does not have any effect!!

Is there a bug that when you specifiy the properties when calling like above it doesnt work?

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information