GithubHelp home page GithubHelp logo

Comments (6)

noncototient avatar noncototient commented on June 14, 2024

Look for my reply in here: #46

Look for $.get and data processing bit.

from bootstrap-year-calendar.

PrinceOfAbyss avatar PrinceOfAbyss commented on June 14, 2024

Unfortunately, you didn't understand my question. The reply you quoted doesn't have anything to do with the problem I'm mentioning here. What I need is a way to re-design the context menu so that I get rid of the first-level option (the "name" of the event).

Basically, I realized yesterday that when there are overlapping events for the same period, those events are displayed there with the Edit and Delete options for each of them. But if you remember my case, I'll be using the background property so that only the latest event is visible for each day. So, it'll be inconsistent to list all events for edition/deletion when the user pops the context menu.

Take a look at the images below to better understand what I mean:

two

Here I have two monthly events, with a price for each event.

overlap

Here I put a single two-month event that overlaps the other two. Background color makes sure that only the top event is displayed at any time, but then, when the user right clicks on a day to display the context menu, bam, both events are shown. Isn't this inconsistent? So, I'll have to alter the context menu calculation algorithm. and instead of looping through the events of that day, I'll be only displaying the last one. But there is no method for doing that in my config file. I'll have to hardcode it in the plugin's JS directly. Any ideas?

from bootstrap-year-calendar.

noncototient avatar noncototient commented on June 14, 2024

What I need is a way to re-design the context menu so that I get rid of the first-level option (the "name" of the event).

I haven't actually used this myself yet, but I assume it displays days using a loop to go through array of options for that day. Would you be able to simply use the last element of that loop to be the option for that day?

For instance, to display the options for a specific day you would have:

for(var i = 0; i < optionsInDay.length; i++){
    console.log(optionsInDay[i]); // <--- that would display the days and their corresponding Edit & Delete
}

So you might just use something like this:
optionsInDay[optionsInDay.length-1]

This is rough and from the top of my head, but it might work :)

from bootstrap-year-calendar.

PrinceOfAbyss avatar PrinceOfAbyss commented on June 14, 2024

There is no method for editing the context menu. That's the problem!

from bootstrap-year-calendar.

Paul-DS avatar Paul-DS commented on June 14, 2024

Hi,

Thank you for your remarks.

You can actually customize the context menu by using the dayContextMenu event of the calendar (see in the documentation).
In your event method, you can create either a full custom menu, or build a menu using the same CSS classes used in the calendar widget :

  • .calendar-context-menu
    • .item
      • .submenu
        • .item

etc...

You can take exemple on the _openContextMenu method of the calendar, which is used to generate the context menu for a day.

Don't hesitate if you have some trouble during implementation, or some good ideas to simplify the customization.

from bootstrap-year-calendar.

noncototient avatar noncototient commented on June 14, 2024

There is no method for editing the context menu. That's the problem!

Yeah I should've mentioned before that what I proposed would require going into the source code of the plugin and making modifications.

But looks like @Paul-DS has provided a better solution :)

from bootstrap-year-calendar.

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.