DoRetrieveDayEvents - How to know about Resouce |
Post Reply |
Author | |
pritpal
Newbie Joined: 25 April 2008 Status: Offline Points: 1 |
Post Options
Thanks(0)
Posted: 27 April 2008 at 9:52pm |
Hello Everybody First timer on board. Just 14 days old in XtreamCalendar space.
I am populating calendar with a single "custom" DataProvider with multiple resources, as
//----------------------------------------------------------------------//
CLASS V32Calendar ..
..
ENDCLASS
//----------------------------------------------------------------------//
METHOD AddSchedules() CLASS V32Calendar Local i // aSchedules := { { 'SUPER', 1 }, { 'MIDDLE', 2 } }
for i := 1 to len( ::aSchedules )
::oResources:Add( CreateResource( self, ::aSchedules[ i,1 ], ::aSchedules[ i,2 ] ) ) next ::oCal:SetMultipleResources( ::oResources ) RETURN nil
//----------------------------------------------------------------------// Static Function CreateResource( oV32Cal, cName, nScheduleID ) Local oResource := CreateObject( oV32Cal:ClsResource ) WITH OBJECT oResource
:Name := cName :ScheduleIDs:Add( nScheduleID ) :SetDataProvider2( "Provider=custom", .f. ) //:DataProvider:CacheMode := xtpCalendarDPCacheModeOff :DataProvider:Create() END Return oResource //----------------------------------------------------------------------// METHOD OnDoRetrieveEvents( dtDay, oEvents ) // Here I populate the events based on my own tables
//
Return NIL
//----------------------------------------------------------------------//
Everything goes well. Calendar is populted properly. The problem is performance issue. As DoRetrieveDayEvents is fired for every resource for a single day, I have no clue how to filter database for events which belong to schedules contained in that resource. I have to pull all events to that day and set ScheduleID member.
This is double work on database engine. Not double, but as many times as many resources are set for the calendar.
Anybody with any idea how to determine to which resource oEvents belongs to?
Regards
|
|
Pritpal Bedi
a student of software analysis & design |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |