ColumnWidthController method sanityCheck missing 'name' property when not using xConfig
Hi,
I implemented sap.m.p13n.Engine on sap.m.Table, registering ColumnWidthController. The delta check for this controller seems to be wrong cause the applyState method of the engine working only for the first time. debbuging it, I have got to the conclusion the 'delta' is not being proccess as it should. on the SelectionController ( which is the base of ColumnWidthController ) in the method 'getPropertySetterChanges', it's trying to find the existing component by comparing 'name' property, since the 'sanityCheck' of ColumnWidthController returns 'name' property only if 'this._bExposeXConfig' is true, the delta check is wrong. My suggestion is to add to sanityCheck return the property 'name = sKey' in addition to the key and value.
ColumnWidthController.prototype.sanityCheck = function (oState) {
var aColumnWidth = [];
if (this._bExposeXConfig) {
if (oState && oState.hasOwnProperty("aggregations") && oState.aggregations.hasOwnProperty("columns")) {
Object.keys(oState.aggregations.columns).forEach(function (sItem) {
var oColumnWidth = {
name: sItem,
width: oState.aggregations.columns[sItem].width
};
aColumnWidth.push(oColumnWidth);
});
}
} else {
Object.keys(oState).map((sKey) => {
aColumnWidth.push({
key: sKey, name: sKey, width: oState[sKey]
});
});
}
return aColumnWidth;
};
BR, Avi
Hi @TawillAvi,
thanks for your pre-analysis. Could you please provide a minimal sample for us to reproduce the issue?
Hi @DonkeyCo, Thanks for the fast respones please see the attached example, if you set a break point on SelectionController line 628, you will the comparation returns wrong values.
Hi any new about this one?
Hi @TawillAvi,
sorry for the rather late reply. A fix is currently in review, the issue state will be updated, once the fix has been merged.
Thank you!