dataProcessor changes URL


#1

Hello,

I’ve started a test system. When saving via the lightbox to the server the URL is changed?
This is my URL:
var dp = new dataProcessor("/savedate.php");

In the console I see the following call:
PUT https://domain.ico/savedata.php/67

The ID is the number of the record. If I open another record, the ID is a different one. The call always creates a 404.

What am I doing wrong here?
Who has an idea?

thanks
ciao Thomas


#2

Hi Thomas,
in answer to this question

When saving via the lightbox to the server the URL is changed?

this is the expected behavior from REST API client, different actions will call different urls and different HTTP methods, urls of ‘delete’ and ‘update’ actions will contain the identifier of the related record.

In order to do this, the first way is to implement REST API on the server - add some routing so that the rest URLs from the client are sorted out and its handler called. You can use some kind of additional library, such as slim:
https://docs.dhtmlx.com/scheduler/howtostart_php_slim4.html

The other way is to use a different value for the setTransactionMode of the dataprocessor https://docs.dhtmlx.com/scheduler/server_integration.html#technique, then all requests will be sent to the same URL.
You can check the tutorial, probably it’s just what you need:
https://docs.dhtmlx.com/scheduler/howtostart_plain_php.html#step1creatingaproject