No announcement yet.
  • Filter
  • Time
Clear All
new posts

    ListGrid.getEditValues in 8.3 nightly always returns new object

    In my code I directly added properties to the object returned from ListGrid.getEditValues, this allowed me to add extra information that should be retained during row editing of different rows.

    I noticed that in 8.3 nightly something changed from a previous 8.1 build (november). In 8.3 the getEditValues always returns a clone of the original edit values object, so directly changing the clone does not change the original and maintained edit values object.

    See these lines in getEditValues:
        var values = isc.addProperties({},this._getEditValues(valuesID, colNum));
        if (values != null) {
            delete values[this.recordRemovedProperty];
        return values;
    My question: is this on purpose that a shallow clone is returned? If so then I think it can make sense to mention this in the doc of the method (that the returned object can't be changed directly). If not, does it make sense to change this and return the original/real edit values object?

    gr. Martin

    Directly modifying this object is definitely not supported. Yes, the clone is done intentionally as the management of editValues had to become more sophisticated as certain ValuesManager and SimpleType features were added.