PDA

View Full Version : [FIXED] Custom ListItem classes are broken in 6.5



bobringer
21 May 2017, 1:05 PM
Ext version tested:
Ext 6.5.0


Description:
ListItem classes throw an exception when applying dataMap to items.



Ext.dataview.DataItem.static.assignDataToItem is looking for cfg.names.setter which has apparently been changed to cfg.names.set in 6.5.

The following override seems to resolve the issue.




Ext.define('ExampleApp.overrides.dataview.DataItem', {
override: 'Ext.dataview.DataItem',
}, function(DataItem) {
DataItem.assignDataToItem = function (record, target, mappings, legacy) {
var configMap = Ext.Config.map,
cfg, dataPath, i, n, name, s, value;

for (name in mappings) {
s = legacy ? name : ((cfg = configMap[name]) && cfg.names.set);
if (!target[s]) {
//<debug>
if (legacy) {
Ext.raise('No method "' + name + '" on ' + target.$className);
} else {
Ext.raise('No config "' + name + '" on ' + target.$className);
}
//</debug>
continue;
}

// This is an array of names to follow from the record. Like in
// data binding these names can be association names or field
// names.
dataPath = mappings[name];
value = record;
for (i = 0, n = dataPath.length; value && i < n; ++i) {
value = value.interpret(dataPath[i]);
}

target[s]((i < n) ? null : value);
}
}
});

evant
21 May 2017, 3:07 PM
Thanks for the report! I have opened a bug in our bug tracker.