ParamQuery Grid
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Help
Search
Login
Register
ParamQuery grid support forum
»
General Category
»
Help for ParamQuery Select
»
How to clone the datamodel into array without effect of datamodel.
« previous
next »
Print
Pages: [
1
]
Author
Topic: How to clone the datamodel into array without effect of datamodel. (Read 4458 times)
maDawi
Newbie
Posts: 2
How to clone the datamodel into array without effect of datamodel.
«
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.
Logged
maDawi
Newbie
Posts: 2
Re: How to clone the datamodel into array without effect of datamodel.
«
Reply #1 on:
May 11, 2018, 12:06:57 pm »
this problem was fixed thank this is my solution JSON.parse(JSON.stringify(datamodel.data)).
Logged
jlawler.scsi
Newbie
Posts: 7
Re: How to clone the datamodel into array without effect of datamodel.
«
Reply #2 on:
July 26, 2018, 10:41:17 pm »
Another solution is to use Object.assign:
Code:
[Select]
var new_data = Object.assign({}, datamodel.data);
Logged
Print
Pages: [
1
]
« previous
next »
ParamQuery grid support forum
»
General Category
»
Help for ParamQuery Select
»
How to clone the datamodel into array without effect of datamodel.