Missing Event reference on external drag & drop item
5 years ago.
Hi everyone! I was hoping for my Javascript code to work properly. I began programming in JS not so long ago and i'm having some problems lately.
More specifically i would like my script to make an AJAX client-side call to the Daypilot Database in order to register as event on db, the external items i want to move on, as soon as i drag them on the event calendar. The Ajax calls i make for the events created with the standard creation mode right inside the calendar seem to work. The problems begin when i drag external elements on it. The method " DayPilot.Calendar.makeDraggable()" provided from the framework should pass the execution control flow to the "EventMove()" method, once the element has been dropped on calendar as the documentation suggests ("After dropping the object the standard EventMove event is triggered.."). So i thought i could make my "POST" ajax call right inside of it obtaining, unfortunately, this runtime error on console: "{"$.id":["The JSON value could not be converted to System.Int32. Path: $.id | LineNumber: 0 | BytePositionInLine: 11."]}" associated with the HTTP bad request Status response (error 400). Should i interpret it as conversion error due to wrong input format of the event attributes or is it possible that the event has not been even created once the html element has been dropped?
Like i said before i'm not that good at programming in JS so i could missing some basic programming logic for it, but i hope i provided a clear enough explanation of the problem.
I'm gonna attach my "EventMove()" method screenshot to the post if it can be helpful for troubleshooting.
Thanks for the more than appreciated help i could receive.
Luca
DayPilot