Print Page | Close Window

Force refresh calendar view with new external data

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=23302
Printed Date: 20 April 2024 at 8:21am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Force refresh calendar view with new external data
Posted By: reinaldo
Subject: Force refresh calendar view with new external data
Date Posted: 01 April 2017 at 11:45am
Hello;

How can I force a refresh of the current calendar view if data has been externally modified?  

Let's say I go and manually make changes to the table holding calendar events while the calendar is open on another workstation.  I have ways to alert the app about the need to re-read data and refresh via a database notification.  That part is not the problem.  My question is, once the app receives the notification and thus it is aware that it needs to display new data, how can I tell the calendar control to re-read events from the data source and re-draw the calendar with the new externally modified data?

So far I've been trying with oCal:Populate() followed by oCal:RedrawContorl(), but that doesn't do anything.

Please help.   Thank you,


Reinaldo.



Replies:
Posted By: reinaldo
Date Posted: 02 April 2017 at 5:29pm
I figure it out.  In case it helps others here is the answer.  First you need to find the event from the events collection for the given day:
oEvents = oCalendar:DataProvider:RetrieveDayEvents( dDate ) 
Now you need to find the particular event that was changed by looping through the events list while comparing some field that you know is unique.  Once you find the event it needs to be changed on the calendar control:
oCalendar:DataProvider:ChangeEvent( oEvents:Event( n ) )
Or removed if the event was deleted:
oEvents:Remove( n )
I hope that helps others in the future.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net