How to know which view a user is in?
5 posts
• Page 1 of 1
Posts: 109
Joined: Fri Jul 17, 2009 7:44 am |
I want to have certain fields display in an event that will depend on which view a user is currently in. For instance, when a user is accessing the Week Schedule view I want them to see some field and when they are in the Resources Schedule I want to show them other fields. Is there a global variable or some other means that I can leverage here? If not, do you think this is possible to create and track?
|
Hi Jim,
In DayBack Classic, there is no trigger to run JavaScript or FileMaker scripts when these things happen. However, in the new DayBack for FileMaker 19 and DayBack Online, you can accomplish these things using custom app actions: https://docs.dayback.com/article/140-custom-app-actions App actions will let you trigger JavaScript or FileMaker scripts whenever something like the view is changed, calendar loaded, filters applied, etc. This will allow you to take these actions to customize the behavior when these things happen. I hope that helps! KC |
|
Posts: 109
Joined: Fri Jul 17, 2009 7:44 am |
We're not ready to work with 19 yet (not with the current project I'm working on) and I do need some way to distinguish between layouts.
I kind of had this idea in mind: I assume when the user clicks a link to change view modes of the calendar, global fields in the CalendarInterface table get populated with data to be exported to the /var/ directory. Would it be possible to check these global field just prior to exporting for the presence of a word or code or comment pattern that would distinguish between the different layouts. Afterall this HTML/Javascript code must be different to enable the webviewer to draw the different screens when requested. Any thoughts on that approach? |
Hi Jim.
When you click a button to change views, the calendar knows you're in this view and saves it as a variable in the javascript session, so FileMaker doesn't know that. If the calendar needs to fetch the new events, it does so, but FileMaker only knows the date range that the calendar is fetching events for ($$sc_DateRangeStartAutoGlobNum and $$sc_DateRangeEndAutoGlobNum). You could use these values to guess which view the user is on, but you wouldn't know the difference between the week schedule, list, or a resource view showing 7 days, for example. So it's probably not that useful. FileMaker doesn't have any feedback about the specific view the user is in. Additionally, this would only work if you disable lazy fetching in the "Webviewer Settings" script. Lazy fetching means the calendar won't necessarily query events if you are in week view and switch to day view, since it already has the data for that time range. Turning off lazy fetching means the calendar will re-query data any time you change views, which might make the calendar a bit slower. Regards, KC |
|
Posts: 109
Joined: Fri Jul 17, 2009 7:44 am |
Ah. I was afraid you might say that. In that case I'll need to change my plans a bit. Thanks for the input. Always appreciated.
|
5 posts
• Page 1 of 1
Return to DayBack Calendar for FileMaker
Who is online
Users browsing this forum: No registered users and 1 guest