Print Page | Close Window

How to disable the sorting for all day event?

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=13066
Printed Date: 01 July 2025 at 1:19pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to disable the sorting for all day event?
Posted By: Makarand
Subject: How to disable the sorting for all day event?
Date Posted: 05 January 2009 at 5:04am
Hi Oleg,

How can I disable the soring for all day event?
please see the attached image for more detail

We do not want to have sorting, since the list we have in database is also not sorted.

Now Codejock sorts the all day items, because of which our database list does not match with codejock all day items list.

Thanks in advance,
waiting for reply,
-Mak



Replies:
Posted By: mdoubson
Date Posted: 05 January 2009 at 12:01pm
Hi,
this is the sort function used inside, e.g. Populate call

int _cdecl CXTPCalendarEvents::CompareEvents_ForView(const CXTPCalendarEvent** ppEv1, const CXTPCalendarEvent** ppEv2)

{

if (*ppEv1 == NULL || *ppEv2 == NULL)

{

ASSERT(FALSE);

return XTPCompare(*ppEv1, *ppEv2);

}

int nPeriodDays1 = (*ppEv1)->GetEventPeriodDays();

int nPeriodDays2 = (*ppEv2)->GetEventPeriodDays();

int nAllDayEvent1 = (*ppEv1)->IsAllDayEvent() ? 1 : 0;

int nAllDayEvent2 = (*ppEv2)->IsAllDayEvent() ? 1 : 0;

BOOL bIsMultidayEvent = (nAllDayEvent1 && nAllDayEvent2 || nPeriodDays1 > 1 && nPeriodDays2 > 1);

int nCmp = 0;

//---------------------------------------------------------------------------

if (bIsMultidayEvent)

{

nCmp = XTPCompare((*ppEv1)->GetStartTime(), (*ppEv2)->GetStartTime());

if (nCmp)

{

return nCmp;

}

}

//---------------------------------------------------------------------------

nCmp = XTPCompare(nPeriodDays2, nPeriodDays1);

if (nCmp)

{

return nCmp;

}

nCmp = XTPCompare(nAllDayEvent2, nAllDayEvent1);

if (nCmp)

{

return nCmp;

}

if (!bIsMultidayEvent)

{

nCmp = XTPCompare((*ppEv1)->GetStartTime(), (*ppEv2)->GetStartTime());

if (nCmp)

{

return nCmp;

}

}

nCmp = XTPCompare((*ppEv1)->GetDurationMinutes(), (*ppEv2)->GetDurationMinutes());

if (nCmp)

{

return -nCmp;

}

//-----------------------------------------------------

nCmp = XTPCompare((*ppEv1)->GetSubject(), (*ppEv2)->GetSubject());

if (nCmp)

{

return nCmp;

}

//-----------------------------------------------------

nCmp = CompareEvents_ByID(ppEv1, ppEv2);

return nCmp;

}

 

virtual void Populate(COleDateTime dtDayDate)

{

.............................................
CXTPCalendarEventsPtr ptrEventsAr = new CXTPCalendarEvents();

............................................

// sort events by start time and some other criteria

ptrEventsAr->Sort(CXTPCalendarEvents::CompareEvents_ForView);

May be we can make this call optional?
Now looks like there is no way to eliminate this sort.


Posted By: zitz
Date Posted: 22 May 2009 at 5:41am
Need to fix it!
Originally posted by <font color='#0000FF'>member_profile.asp?PF=4721&FID=115</font> - mdoubson member_profile.asp?PF=4721&FID=115 - mdoubson wrote:

]May be we can make this call optional?

I want add my own sorting.
How can I overload it?



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