3.2.0

changing array data

looking for a simple method for changing array data

thierry
June 26,
I finished to understand that we must change the data ouside the widget (the paramater of setDataProperty function).

The widget does not create another array but reads the initial mydata array.

Thanks
thierry
June 26,
If you use a javaarray to hold data you probably wants to have the posibility to roll back data for the row

use a clone function to clone a array otherwise there is a risk that you work whith a pointer to the orginal data array.


function cloneObject(what) {
for (i in what) {
if (typeof what[i] == ''object'') {
this[i] = new cloneObject(what[i]);
}
else
this[i] = what[i];
}
}

var myData = [
["MSFT","Microsoft Corporation", "314,571.156", "32,187.000"],
["ORCL", "Oracle Corporation", "62,615.266", "9,519.000"],
["SAP", "SAP AG (ADR)", "40,986.328", "8,296.420"],
["CA", "Computer Associates Inter", "15,606.335", "3,164.000"],
["ERTS", "Electronic Arts Inc.", "14,490.895", "2,503.727"]
];

//make a clone
var myDataOrginalCopy= new cloneObject(myData);
Andersson
June 27,
ok
but i prefer to have only one array in memory.
The widget points to that array.
I think that is ok like that.
Thierry
June 27,

This topic is archived.

See also:


Back to support forum