Thank in advance and i am having hard time autsync work for new assignments
on your demo at https://bryntum.com/products/schedulerpro/examples/nested-events-drag-from-grid/ if i set autosync to true and assign an item from right it sends a sync request and get stuck in sync loop , update and delete work fine , i am using gantt too and autosync on new task works fine and i am using same response structure in above example but it just get stuck in loop,
also could not add json response here as it keep giving me this error even when i wrap it in [ CODE ] [ /CODE ]
'Please wrap your code in [ CODE ] [ /CODE] tags'
Attachments
Screenshot 2022-11-24 at 17.01.06.png (104.62 KiB) Viewed 716 times
What operation have you done to get this response? As I understood - you dropped a nested event into one of events from the list?
What do you see in requests when you have a loop? In first request? In first response? In other responses? I see only assignment added in the response, but what about event added?
Please also make sure you used latest released version, we had some problems with assignments adding in on one previous versions.
Any chance to check what your config looks like?? Maybe a sample project with that would be great to help you and understand the problem to assist you better.
would process only resources.add request and assign $PhantomId to id column , i know you may say the response structure i am returning wrong but again that was the question in first place
{
autoLoad: true,
autoSync: true,
transport: {
load: {
url: './data/data.json',
},
sync: {
requestConfig: {
url: 'https://backend.staging.app.worksavi.com/api/wae/test_bryntum',
method: 'POST',
disableCaching: false,
fetchOptions: {
credentials: 'omit',
},
headers: {
'Content-Type': 'application/json; charset=utf-8',
Accept: 'application/json',
'X-Tenant': '093f1b6a-2e69-4e63-a125-e71575330379',
},
},
},
},
eventStore: {
// Dont remove unassigned events, we want to display them in the unplanned jobs grid
removeUnassignedEvent: false,
},
}
Thank you for the test case. I ran your code and see the next notification in the console:
Project sync response error(s):
- "assignments" store "rows" section should mention added record(s) #_generatedClassDefEx_59decd2b-613c-4dd5-afe3-b01c77840f42 sent in the request. It should contain the added records identifiers (both phantom and "real" ones assigned by the backend).
Please adjust your response to look like this:
{
"assignments": {
"rows": [
{
"$PhantomId": "_generatedClassDefEx_59decd2b-613c-4dd5-afe3-b01c77840f42",
"id": ...
}
]
}
}
Note: To disable this validation please set the "validateResponse" config to false
Your response doesn't have new id and it's also encoded. I've attached 2 examples of response. First one yours and second one from our php example. Please see only encoding and not formatting. There are different examples.
Please try to fix it and test again.
Attachments
Screenshot 2022-12-01 at 18.57.10.png (131.62 KiB) Viewed 591 times
Screenshot 2022-12-01 at 18.56.43.png (129.57 KiB) Viewed 591 times
well thats weird that for you response is not json because the second screenshot i attached of response clearly is json encoded and i can even in response header see that Content-Type: application/json (i am on chrome) , wil apply your suggestion about wrapping the response array in "rows" index