cancel
Showing results for 
Search instead for 
Did you mean: 

Copy Date from JSON Model, but not by Reference..

Former Member
0 Kudos

Hello Experts,

at the Moment im trying to copy an entry from an Array which is stored in a JSON Model to another JSON Model (Business Case: Click an Entry on an Table, open a PopUp to change the Values, just change the Values if the user presses the "Change" Button).

But the value is just passed by Reference and not the Value itself, so when i change the Value in the second Model the Value automatically changes in the first model.

Is there any approach to copy values between two JSON models?

Thanks for your Help!

Sascha

Accepted Solutions (1)

Accepted Solutions (1)

DK007
Active Participant
0 Kudos

Hi,

Use below code to make a copy of the object or array.

tempArr = jQuery.extend({}, orginialArr);

Thanks,

Dheeram

Former Member
0 Kudos

Thanks for the fast response! Works like a charm for me!

Answers (0)