ParamQuery grid support forum

General Category => Help for ParamQuery Select => Topic started by: maDawi on May 11, 2018, 11:49:26 am

Title: How to clone the datamodel into array without effect of datamodel.
Post by: maDawi on May 11, 2018, 11:49:26 am
How to clone the datamodel into array without effect of datamodel. when I change the all value of my array into string, the datamodel value change it too into string. how to fix it thank you.
Title: Re: How to clone the datamodel into array without effect of datamodel.
Post by: maDawi on May 11, 2018, 12:06:57 pm
this problem was fixed thank this is my solution JSON.parse(JSON.stringify(datamodel.data)).
Title: Re: How to clone the datamodel into array without effect of datamodel.
Post by: jlawler.scsi on July 26, 2018, 10:41:17 pm
Another solution is to use Object.assign:

Code: [Select]
var new_data = Object.assign({}, datamodel.data);