Giter Site home page Giter Site logo

Comments (8)

kthornbloom avatar kthornbloom commented on August 23, 2024

Hi, no option for that currently but I will keep it in mind for future updates. I'm sure you're aware, but you could just load several months of xml which this plugin can sort through on its own rather than giving it a single month at a time.

from monthly.

shubhamtakode avatar shubhamtakode commented on August 23, 2024

There is no option/button/link for closing events list after its popped up. Although it can be closed on clicking calendar icon, but there should be one.

from monthly.

kthornbloom avatar kthornbloom commented on August 23, 2024

Hi @shubhamtakode. The calendar icon is the button you are looking for. (click the calendar icon to go back to the calendar)

from monthly.

mxbode avatar mxbode commented on August 23, 2024

A reload function which will reload the xml-source and refresh the calendar would be nice. Now I'had to work around with an iframe :(

from monthly.

keegars avatar keegars commented on August 23, 2024

Call the renderCalendar with a string of where the xml data lies, and it will regenerate the calendar.

$.get("test.xml", function (dataset) {
    renderCalendar(dataset);
}).fail(function () {
    console.log("Failed to get xml"");
});

function renderCalendar(xml) {
    $("#calendar").empty();
    $("#calendar").monthly({
            xmlUrl: xml
    });
}

from monthly.

LinkBenjamin avatar LinkBenjamin commented on August 23, 2024

I was trying to do this following @keegars suggestion but it doesn't behave very well.

I have an HTML Select box that the user chooses a value, and I go to retrieve the calendar information as follows:

$('#dateField').change(function(){
        var dateFilter=$('#dateField').val();

        console.log("DateFilter = " + dateFilter);
        $('#mycalendar').empty();
        $('#mycalendar').monthly({
            mode: 'event',
            jsonUrl: '/api/public/eventcalendar?dateFilter=' + encodeURIComponent(dateFilter),
            dataType: 'json'
        });
    });

It renders the current month properly, but we have stuff scheduled for several months into the future and it all goes wonky when I try to navigate forward in time. Months get arbitrarily skipped, and events show up on the wrong dates.

Any word on when the enhancement might be released? Being able to render the calendar on the fly like this will be a great improvement.

from monthly.

kthornbloom avatar kthornbloom commented on August 23, 2024

@LinkBenjamin It's probably related to some JS variable or jQuery data object not getting cleared out. A (somewhat ridiculous) workaround would be to remove the element altogether and replace it with a new ID which would definitely work since all of that data is connected to the element ID.

So this should work:

    ('#dateField').change(function(){
        var dateFilter=$('#dateField').val();

        console.log("DateFilter = " + dateFilter);
        $('#mycalendar').empty().replaceWith('<div class="monthly" id="newId"></div>');
        $('#newId').monthly({
            mode: 'event',
            jsonUrl: '/api/public/eventcalendar?dateFilter=' + encodeURIComponent(dateFilter),
            dataType: 'json'
        });
    });

You might dynamically generate a random ID so it's more re-usable. Not the best solution, but it's the best I can provide at the moment! This plugin needs refactoring someday...

from monthly.

LinkBenjamin avatar LinkBenjamin commented on August 23, 2024

Thanks for the tip. I tried it out and it behaves better now! I ended up deleting based off the class rather than the ID, but then randomly generating an id:

$('#dateField').change(function(){
        var dateFilter=$('#dateField').val();

        newid= new Date().getTime();

        $('.monthly').empty().replaceWith('<div class="monthly" id="cal' + newid + '"></div>');
        $('#cal' + newid).monthly({
            mode: 'event',
            jsonUrl: '/api/public/eventcalendar?dateFilter=' + encodeURIComponent(dateFilter),
            dataType: 'json'
        });
    });

Now whenever I flip the select element, I get the filter applied to my calendar.

Thanks!

from monthly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.