Attach/override FullCalendar deleteEntry js function

achartier

Administrator
Staff member
I can't seem to figure out how to point to the deleteEntry function inside fullcalendar.js.

My goal is to ask the user a question after they agree to the deletion and to send the answer to that question along in the delete url. I will act ion this information in the onDeleteRowsForm plugin.

My thinking was that I would place code in the visuatization_1.js file (which does get included by the way) in a document ready function. something like this:
Code:
jQuery('document').ready( function()
{
    var fabDeleteEntry = deleteEntry;
    deleteEntry = function(calEvent) {
        if (window.confirm(Joomla.JText._('PLG_VISUALIZATION_FULLCALENDAR_CONF_DELETE'))) {
            var extra = false;
            if (window.confirm('do you want special stuff?')) {
                extra = true;
            }
            this.ajax.deleteEvent.options.data = {'id': calEvent.rowid, 'listid': calEvent.listid};
            if (extra == true)
                this.ajax.deleteEvent.options.data.extra = true;
            this.ajax.deleteEvent.send();
        }
    }
});
But I cannot seem to find the right way to get a pointer to the deleteEntry function. I have tried FullCalendar.deleteEntry, visualization_1.FullCalendar,deleteEntry, visualization_1.deleteEntry etc. on the first var line. They all come back undefined.

Can you help me out? Thanks.
 
You won't be able to do that from "outside".

I've added a way to do it in this commit:

https://github.com/Fabrik/fabrik/commit/bbaba82a511a0958a93a7368c55325366141563b

... that adds the 'fabrik.viz.fullcalendar.deleteentry' event, which can return an object of prop/value pairs which our code will then nerge into the data it hands to the AJAX call:

Code:
requirejs(['fab/fabrik'], function() {
   Fabrik.addEvent('fabrik.viz.fullcalendar.deleteentry', function(viz, calEVent) {
      return {'foo': 'bar', 'baz':123};
   });
});

You can get at the event details in the calEvent arg.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top