we are currently trying to let the user reorder resources via drag'n'drop using the RowReorder feature in a tree view. To update our entities we are using a CrudManager with autoSync and writeAllFields enabled.
We are using Bryntum Scheduler Pro 5.2.10 with Angular 11.0.2
I've created a simple test case with a sync function that produces a fake response. Moving a record to a different position doesn't trigger the sync, not even once.
We have also the problem, that orderedChildren is undefined (in sortOrderedChildren) if we don't use this workaround:
const newResource = new ResourceModel({
name: `Resource ${resourcesCount + 1}`,
parentId: null,
children: [],
});
// temporary? fix for empty orderedChildren
(newResource as any).orderedChildren = [];
At first we tried to use a custom field to track the order of the items but with help of the docs we found out there should be a field that keeps track of the order, see: SchedulerPro.model.ResourceModel#field-orderedParentIndex
Now the question as stated above is, if it is possible to auto trigger the sync when that field changes and to provide that field in the CRUD request.
#2
The second topic i've addressed was that there is an error when initializing a tree node with an empty children array. I've therefore attached a screenshot of the error message, but i could open a separate thread for this issue if you like to.
Attachments
orderedChildrenError.png (34.48 KiB) Viewed 312 times
The second topic i've addressed was that there is an error when initializing a tree node with an empty children array. I've therefore attached a screenshot of the error message, but i could open a separate thread for this issue if you like to.
Yes please keep one issue/thread, if you can open a new thread with info how to reproduce - we'll get it fixed.
That's not global index as you see in docs, but it's also an option for tree stores to have it in payload. But you won't be able to manually change/set value for that field because it's internal and readOnly.
All you need to have it in payload is to make it peristable.
project : {
autoLoad : true,
autoSync : true,
transport : {
load : {
url : './data/data.json',
},
sync : {
url : './data/data.json',
}
},
resourceStore : {
tree : true,
fields : [{
name : 'orderedParentIndex',
type : 'number',
persist : true // this that need to be changed, by default it false
}]
}
},
After that it will trigger sync on reorder with orderedParentIndex value.