How to update PHP database calendar after using jQuery drag and drop?

I have a calendar built using PHP with events on it.

I use jQuery UI to enable drag and drop to move events around. The .droppable () function has an associated callback function that updates the database with new information. But the calendar needs to be updated so that it reads from the new database values.

Can you force page refresh using jQuery? Or is there a better way to do this?

+3
source share
4 answers

Perhaps this is what you want?

$("div.myCalendarCell").droppable({
    addClasses: false,
    accept: "div.myEvents",
    activeClass: "active",
    hoverClass: "hover",
    drop: function(event,ui) {  
        var myFormData = $(this).find("form.myEventFormData").serialize();
        $(this).load("php/myEventManager.php",{"myFormData":myFormData},function(e){
            alert("updated");
        });
    }
});
+1
source

ajax- php, .

.droppable(function(){

  $('#calendar').load('scriptname.php', {variable1: 'var1', etc...});

});
+1

location.reload(true) - , .

$('.selector').droppable({
   drop: function(event, ui) { location.reload(true); }
});
0

, , HTTPXmlRequest - ... , ?

... , , <form>, ? , , - Sweet Rich-UI Ajax Action, Sweet Rich-UI Ajax Action " ".

0

Source: https://habr.com/ru/post/1729138/


All Articles