javascript - Change in copied object reflects in source cell on handontable drag -
i having object
var x1 = {t1: 'test1', y1: 'testy1'}; var x2 = {t1: 'test2', y1: 'testy2'}; var x3 = {t1: 'test3', y1: 'testy3'}; var data = [ {id: 1, name: 'ted', isactive: x1}, {id: 2, name: 'john', isactive: x2}, {id: 3, name: 'al', isactive: x3} ]
i bind data handontable. want modification in destination object on drag.
beforeautofill = function (start, end, data) { data[0][0].t1 = 'tt1'; };
this code should change row 1, test2 tt1.
but changes both rows(0 , 1) tt1.
i think issue of shallow copy object of source.
Comments
Post a Comment