Prevent event drag for current date

i want to prevent the events in current date from dragging to other dates… dragging them based on time keeping the date same is to allowed…

Is it possible to do so??

You can use onBeforeDrag event to store current date in some global var, and use onBeforeEventChanged to check is the date the same , and reset it back or block drag event if date was changed.

Thank you Stanislav for ur response… i have a problem in getting current date in onBeforeDrag event… it would be really helpful

Thanks again

onBeforeDrag provides “id” as first parameter, which you can use as

var start_date = scheduler.getEvent(id).start_date

Thanks Stanislav but the think that i realised now is that the events which i drag and drop go back to their initial position on refresh… i need to make save it to database if i dragged and dropped an event to some some date or time… how to do it??

Check
samples\01_initialization_loading\05_loading_mysql.html

It shows how saving of changes can be enabled, it will save all changes without relation were they done by dnd or by some other actions.

Thanks for ur response Stanislav …
but the above example doesnot show how to save on drag or dropping events… the problem i am having is its getting saved to database when i double click on the event but if i drag it … on refreshing the page… the dragged event get back to the inital state…

Please help me out of this…

but the above example doesnot show how to save on drag or dropping events.
When data saving initialized - it will save result of any operation, including dnd, there is no need for some dnd specific commands.

but if i drag it … on refreshing the page… the dragged event get back
Can you enable server side logs and check which operations executed on server side after DND, the problem can be caused by some DB level problem

Stanislav … i had earlier used MySQL as db now changed it to MySqli from then drag and drop doesnt update to database… i u help me to find where should i make modifications so that it may work…

Which server side code you are using for Mysqli?
In case of connector you need to use different DB adapter - db_mysqli.php and MySQLi as DB type in connector’s constructor

The mysqli db adapter is attached.
xx_sample_mysqli_connector.zip (646 Bytes)
db_mysqli.zip (1.39 KB)

i am using PHP as my server side language… and i didnt find db_mysqli.php file… where shall i find it…

oh thanks for the attachment i will check it and response…

It worked for me… thank u very much…