Comments (6)
Look for my reply in here: #46
Look for $.get and data processing bit.
from bootstrap-year-calendar.
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:
Here I have two monthly events, with a price for each event.
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.
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.
There is no method for editing the context menu. That's the problem!
from bootstrap-year-calendar.
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.
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)
- Full Example - Name and location dont populate
- TypeError: $(...).calendar is not a function
- listed bellow HOT 1
- [Bug] IE11 can not display box-shadow correctly
- disabled day
- How to overlap only with first day of range
- Bug: WeekNumber is one week too late
- Project still active? HOT 6
- Issue With Bootstrap 4 : Months Calendar Box is showing vertical HOT 1
- Other customize Date style
- Change outlook of RangeSelection
- how customize contextMenuItems?
- Need event for when you click on a day of the week
- March 31 no displayed HOT 2
- Trouble Rendering Datasource from SQL query
- Could someone add the German language to this package?
- Date's from database not showing in the calendar on Safari browser HOT 1
- add Arabic language
- Add Belarusian translation
- Show prices on each day
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrap-year-calendar.