Hello,
While trying to understand how/why the treeview component could determine if the data is hierarchical or flat, I came across these lines of code in file @syncfusion/ej2-vue-navigations/node_modules/@syncfusion/src/treeview/treeview.js (line 783 and down) for version 18.4.41.
TreeView.prototype.getDataType = function (ds, mapper) {
if (this.fields.dataSource instanceof DataManager && (this.fields.dataSource.adaptorName !== 'BlazorAdaptor')) {
for (var i = 0; i < ds.length; i++) {
if (this.isOffline) {
if ((typeof mapper.child === 'string') && isNOU(getValue(mapper.child, ds[i])) && !isNOU(getValue(mapper.parentID, ds[i]))) {
return 1;
}
}
else if ((typeof mapper.child === 'string') && isNOU(getValue(mapper.child, ds[i]))) {
return 1;
}
}
return 2;
}
for (var i = 0, len = ds.length; i < len; i++) {
if ((typeof mapper.child === 'string') && !isNOU(getValue(mapper.child, ds[i]))) {
return 1; // was 2
}
if (!isNOU(getValue(mapper.parentID, ds[i])) || !isNOU(getValue(mapper.hasChildren, ds[i]))) {
return 2; // was 1
}
}
return 2; // was 1
};
The old values are noted "was x" where I swapped in fact values 1 and 2.
I discovered this because I wanted to load hierarchical data from database, but never managed - the ideal would be to be able to "force" the datatype using a new property.
Could this be a bug ?
Thank you
Julien
PS: I use this version and not latest because it's the latest workable version on Nuxt