I am trying to create a context menu on a single click. I have the code ready to implement this. However I am trying to find out the right object/events to use.
Lets say one day has an appointment set, and one day does not. What event can I use or what objects can I use through Javascript to see if the day that was just clicked on has an appointment set?
Here is the current event I am using, which works, but when I click on an appointment nothing fires.
function WebScheduleInfo1_ActiveDayChanging(oScheduleInfo, oEvent, oOldDate, oNewDate) { console.log(oScheduleInfo); console.log(oEvent); console.log(oOldDate); console.log(oNewDate);
}
Which object will hold the value of weather an appointment is set that day or not?
Anyone have any ideas?
Hi OmegaPrime,
If you are using WebMonthView, I would suggest you to handle its MouseDown event and see if the clicked element is empty, If it is, then there is no appointments on this date. For example:
function onMouseDown(oWebMonthView, oEvent, element) { if (element.children.length == 0) { console.log("No appointment"); }}
Let me know if this helps.
Hi. I was doing some initial testing on the grid and could not get the data clientside. But when I inserted keys/datakeys for the elements in the calender it all turned around. The click events, and activitydialogedit/open events seem to work properly.
Don't know if this is related to your problem, but it sure was an eyeopener for meg :-)
Without keys (or datakeys) it all seems to fall apart..
Did you add the keys through javascript or server side?
The keys were added serverside.
Hello OmegaPrime,
Please refer to this thread - http://es.infragistics.com/community/forums/t/75490.aspx.
Hey Nikolay,
I tried to make another reply in the thread you linked. It kept erroring out. Are you able to move this reply to that thread?
---
Lets say each day can fit 4 activities just fine and no scroll bars are visible. When you have more than 4 scroll bars are visible which is fine. Lets say the active day is Nov 16th, and I click on the down arrow of Nov 15th. It will activate the ActiveDayChanging event even tho I am clicking on the down arrow of the scroll bar inside the day.
Is there a way to prevent that event from firing easily if I click on the scroll bar arrows? Other than that it is working very well so far.
Hello,
If you need any further assistance with the matter, please feel free to contact me.
You could check what element is clicked from the MouseDown event and then access it in ActiveDayChanged. If it is not a button, execute your code. For example:
var el;function onMouseDown(oWebMonthView, oEvent, element) { el = element;}
function onActiveDayChanged(scheduleInfo, e, newDate) { if (el.tagName != "BUTTON") {...}
Hope this helps.
To expand on this bug further, when you click the Previous Month or Next Month button, this event fires and is popping up my context menu. There has to be a way to prevent at least that from happening?
Is there no way around this? No way to check if the click resulted on a scroll bar? If not, I appreciate all the help you have given me. :)
It seems that this is not possible. And it is expected ActiveDayChanging to be fired because even if you click the scroll arrow, the active day still changes.