Create event causes three requests to the server.
- retokiefer
- Posts: 5
- Joined: Mon Aug 03, 2020 8:36 pm
Create event causes three requests to the server.
Dear all,
whenever the create event dialog ist saved, there are three (3) requests to the server. And I wonder how to send the request only once because three events are created on the server.
I've red in the forum, that the JSON response from the server must habe a certain format. This is what I sent back from the server after the successful creation of an event:
Code: Select all
{"Id": 125, "Name": "Test", "ResourceId": null, "StartDate": "2019-09-06T17:00:00+02:00", "EndDate": "2019-09-06T18:00:00+02:00", "AllDay": false, "RecurrenceRule": null, "Success": true}
Any help is highly appreciated and thanks in advance,
Reto
Re: Create event causes three requests to the server.
Sounds strange, it should issue just one request. Response should look like:
(data is your root property)
Code: Select all
{
"success": "true",
"data": [
{
"id": 1,
"name": "Philip J. Fry"
},
{
"id": 2,
"name": "Hubert Farnsworth"
},
{
"id": 3,
"name": "Turanga Leela"
},
{
"id": 4,
"name": "Amy Wong"
}
]
}
@bryntum
API documentation
- retokiefer
- Posts: 5
- Joined: Mon Aug 03, 2020 8:36 pm
Re: Create event causes three requests to the server.
Thanks Mats, but this didn't made a difference.
AutoSync is enabled, maybe that's the problem. Basically I am using your example of the MVVM Calendar with the following modifications:
Code: Select all
stores : {
calendars : {
type : 'calendarresourcestore',
storeId : 'resource',
data : [
{ "Id" : 1, "Name" : "Work", "Color" : "#249fbc" },
{ "Id" : 2, "Name" : "Birthdays", "Color" : "#ffc107" },
{ "Id" : 3, "Name" : "Hobbies/Courses", "Color" : "#e44959" }
]
},
events : {
type : 'calendareventstore',
storeId : 'event',
autoSync: true,
proxy: {
type: 'ajax',
api: {
read: 'localhost/api/listTeilnahmen',
create: 'localhost/api/listTeilnahmen',
update: 'localhost/api/listTeilnahmen',
destroy: 'localhost/api/listTeilnahmen',
},
reader: {
type: 'json',
rootProperty: 'records',
totalProperty: 'totalrecords',
idProperty: 'id',
},
writer: {
type: 'json',
writeAllFields: true,
expandData: true,
}
},
}
}
Thanks in advance and best regards,
Reto
- retokiefer
- Posts: 5
- Joined: Mon Aug 03, 2020 8:36 pm
Re: Create event causes three requests to the server.
The api URLs are different ones of course. The rest of your example is the same.
- pmiklashevich
- Core Developer
- Posts: 3390
- Joined: Fri Apr 01, 2016 11:08 am
Re: Create event causes three requests to the server.
Reproduced, thank you! Ticket here: https://app.assembla.com/spaces/bryntum/tickets/9634-many-create-requests-are-sent-when-autosync-is-enabled/details