Silk UI Calendar trap prev/next month event

Silk UI Calendar trap prev/next month event

  

Hi,

I have a mobile app screen containing 2 blocks, 1 with the silk UI calendar and below that 1 with the actual event details for the selected date.

I am able to change the 2nd block event details when the on Select event is issued but my problem is that when I use the previous/next month arrows, those event details are not cleaned up.

Is there a way to trap the prev/next month event?

Many thanks in advance for your response.


KR,

Eelco




Hi Eelco,

If I'm not mistaken, the previous/next month arrows just show the previous/next month so the user can select a new date, but there's no actual date selected yet. So it makes perfectly sense imho that there's no event fired for that.

Kilian Hekhuis wrote:

Hi Eelco,

If I'm not mistaken, the previous/next month arrows just show the previous/next month so the user can select a new date, but there's no actual date selected yet. So it makes perfectly sense imho that there's no event fired for that.

Hi Kilian,


Thanks for your reply but I do have a situation where it does make sense:

The calendar shows events in the selected month.

Whenever I select the date, the second block displays the event information and because it can be several events on 1 day, it displays them in a list group.

When the user selects a different date, the list group is automatically refreshed with the event details of that day, which of course can also be none.

But what happens if the user selected a date with events and then switches the months, then the event details remain in the list group/block but there is no date selected hence the days in that month do not relate to the events.

This gives the user wrong information.


So there is a situation where is make sense to refresh the second block data when the user switches months.

I'm thinking of making an overlay DIV with prev/next buttons on my own and then navigating to the screen over and over with a different calendar month start date but It is performance consuming, it would be much easier to trap the javascript event.


KR,

Eelco.




Hi Eelco,

I understand what your usecase is, however the RichWidgets "calendar" is really a datepicker, so it just doesn't support what you need.

Kilian Hekhuis wrote:

Hi Eelco,

I understand what your usecase is, however the RichWidgets "calendar" is really a datepicker, so it just doesn't support what you need.

Hi Killian,

If the Silk UI Calendar is only a date picker than it would't have an event list as parameter.

It does support what I need with 1 disadvantage and for that I will find a solution.


KR,

Eelco.  


Hello Eelco,

Have you been able to find a solution?

I would just like to understand your problem better. What you want to do is simply to refresh your container with the events' information once you change the months? 

Hi Rita,

I've not yet found a solution (I started working on another feature).

You're correct, I want to refresh the container (Block) when the user changes the months.

Selecting another date does that, but moving forward to another month not.


KR,

Eelco.




I tested it on my side, I was even going to suggest to maybe do an eventListener on the arrows themselves but not even that works.

The only solution that I really see would be copying the Calendar to your side and changing the code directly. Adding an event everytime that it calls the back/forward functions. It would be basically following what it's already done with the Select. 

Sorry for not being able to help further and good luck!

Hi Rita,

Thanks for your help. Copying the Calendar to our side is the option i'm going to explore.


I'm not sure you need a complete copy - since it's client-side Javascript, you may be able to hook into it to get what you want.

Hello Kilian,

Unfortunately, you can't and the easiest way really seems, to me, to be to copy the whole thing and change the code directly within the Calendar.

I did tests yesterday and what I noticed was that eventListeners done from the 'outside' were erased after the first run (which I imagine is something that the Calendar's code must be doing), hence my suggestion.

Solution

Hi Rita, Kilian,

I managed to copy the Calendar.

It took me a while figuring out how to copy a system app without having it be hidden all the time in my app list (I'm a newby :-))

I added the OnNavigate event and altered the javascript to call the event whenever the user navigate day, months and year.

It works flawless and I'm happy with it.

Isn't there a way to address this as a new feature in the next silkUi release?


Anyway, many thanks for your support.  


KR,

Eelco.

Solution

Hi Eelco,

You could post an idea in the Ideas section, and let us know here. I'll give it a +1 :).