alex.l wrote: ↑Mon May 09, 2022 9:19 amHi probo,
I don't see you removed load/sync URLs from crudManager as Johan adviced and use AjaxStore together with crudManager load calls, so this is one of potential problems.
You used custom field names (resource_id) so please post Resource model code as well (I mean ProductionUnit).
It will be great if you just zip and attach a runnable test case with JSON examples you used for it. We need to reproduce the problem to help you with that. For now it just works in case we update resources using our examples.Thank you!
So i've prepared a new testcase. Alex, i will send you the zip file for this issue. Also i want to point out that it doesn't make a difference if you use syncDataOnLoad or not, i left it in for this example. I've adjusted my project settings as follows:
project: {
resourceModelClass: ProductionUnit,
assignmentStore: {
syncDataOnLoad: true
},
eventStore: {
fields: [
'sourceData',
'type',
'type_id'
],
syncDataOnLoad: true
},
resourceStore: {
syncDataOnLoad: true
},
transport: {
load: {
url: '/print-planning/plannable-items',
},
sync: {
url: '/print-planning/plannable-items/sync',
},
},
validateResponse: true,
autoSync: true
},
Here is my combo field
{
type: 'combo',
displayField: 'name',
valueField: 'id',
store: new Store({
data: [
{
id: 3,
name: 'Sublimation'
},
{
id: 5,
name: 'Sheet'
},
{
id: 8,
name: 'Wood'
}
]
}),
listeners: {
change(data) {
const scheduler = this.parent.parent;
const project = scheduler.project;
project.transport.load.url = '/data/machine-' + data.value + '.json';
project.load();
}
}
},
What we want to achieve, is when you switch to another resource using the combo box that it loads the assignments, events and resources from the json files. It loads the resources but not the events.
STR:
- Select Sheet as your first selection (events are visible)
- Select Sublimation as your second choice
- Select Wood as your third choice
- Select Sheet again as your option
Actual result: Events are not visible anymore
Expected results: Events are visible
Kind regards,
probo