CalendarXP.net Support Forum Index CalendarXP.net Support
Most forums here are private and invisible to public.
 
 FAQFAQ   SearchSearch   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Multiple calendars and color change when 2 dates are clicked.

 
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> FlatCalendarXP Related
View previous topic :: View next topic  
Author Message
vipinc



Joined: 30 May 2008
Posts: 8

PostPosted: Fri May 30, 2008 5:07 pm    Post subject: Multiple calendars and color change when 2 dates are clicked. Reply with quote

Hi,
I have got 2 calendars in one form. What I need is , when I click 2 dates , the dates between them should change color so as to represent "Selected From date1 to Date2". How do I do this?

Also this needs to work when I click Date1 in the first calendar and Date2 in the second.

Thanks in advance.

regards,
Vipin
Back to top
View user's profile Send private message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Fri May 30, 2008 10:46 pm    Post subject: Reply with quote

This needs some configuration and coding. I'd suggest you take a look at the MultiPickerDemo2 (in the original package you received), and see if it meets your requirement.

In the meanwhile, we'll forward this to our development team and see if we can build a demo for you.

_________________
Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.
Back to top
View user's profile Send private message
vipinc



Joined: 30 May 2008
Posts: 8

PostPosted: Sun Jun 01, 2008 2:58 pm    Post subject: Reply with quote

Hi,
Infact I have already had a look at the multipicker2 demo.. But in it, you need to use CTRL+click to acheive wht I wanted. Is there any way I can avoid the CTRl key?

Appreciate all help. Do let me know incase you want to take a look at my code or if you have any suggestions

regards,
Vipin
Back to top
View user's profile Send private message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Sun Jun 01, 2008 5:42 pm    Post subject: Reply with quote

That's easy. You just need 2 modifications to the plugins2.js file on the MultiPikcerDemo2:

1. find the following line in the fOnDrag() function, about line 44:
Code:
fRemoveRange(y,m,d,bRangeClick||(e?e.button==2||e.which==3:false));

and replace it with
Code:
fRemoveRange(y,m,d,true);
This will deselect the whole range if you click a seletected date.

2. find the fCheckKeyPressed() function around line 206 and replace it totally with the following one:
Code:
function fCheckKeyPressed(key,e) {
   if (!gContainer._gclicks) gContainer._gclicks=0;
   
   return gContainer._gclicks++%2==0?false:true;
}
This will, instead of checking for key pressed, make the 1st click to be the start of range and the 2nd click to be the end of range.
_________________
Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.
Back to top
View user's profile Send private message
vipinc



Joined: 30 May 2008
Posts: 8

PostPosted: Sun Jun 08, 2008 4:49 pm    Post subject: Reply with quote

Thanks .. That worked !!

But a new problem has risen. When the user does a 3rd click or a fourth, among the dates clicked, I want the lowest date to be the start date and the farthest date to be the end date and have the dates between these highlighted.

Did try a few things , but has not worked.

Can u help me with this?

Thanks.
Back to top
View user's profile Send private message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Mon Jun 09, 2008 4:16 am    Post subject: Reply with quote

We've just updated the RangePickerDemo in the latest version, which works exactly as you required. Please go ahead and download the new version and try.

http://www.calendarxp.net/forum/viewtopic.php?p=705

_________________
Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.
Back to top
View user's profile Send private message
vipinc



Joined: 30 May 2008
Posts: 8

PostPosted: Tue Jun 10, 2008 6:09 am    Post subject: Reply with quote

The 3rd click is still the problem.. The 3rd click is taken as the Start Date

regards.
Back to top
View user's profile Send private message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Tue Jun 10, 2008 6:35 pm    Post subject: Reply with quote

It's designed to be that way - if always using the lowest/furtherest date, then the user will never be able to shrink the range.

Also the logic is defined in the fAddRange() function of the plugins.js, you may easily modify it to suit your own taste.

_________________
Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.
Back to top
View user's profile Send private message
vipinc



Joined: 30 May 2008
Posts: 8

PostPosted: Mon Jun 16, 2008 5:13 pm    Post subject: Reply with quote

Hi,
Which are the situations in which the selection goes out of range and it becomes impossible to do any further selection ?

I am using the Range Picker plugin

Thanks
Back to top
View user's profile Send private message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Mon Jun 16, 2008 8:44 pm    Post subject: Reply with quote

I guess you meant which condition parameters to control the boundaries of the range - if so, please take a look at the gBegin and gEnd options in the THEME_NAME.js file (in your case it's the xp.js).
_________________
Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.
Back to top
View user's profile Send private message
vipinc



Joined: 30 May 2008
Posts: 8

PostPosted: Tue Jun 17, 2008 3:48 pm    Post subject: Reply with quote

Yeh.. I knew that .. but in my calendar implementation, the fAfterSelected function is not called after the calendar is clicked 9 to 10 times. Any ideas ?

Following are my plugin.js and xp.js files.
http://207.58.151.235/~malabarh/newmalabar/RangePicker/plugins.js
http://207.58.151.235/~malabarh/newmalabar/RangePicker/xp.js

Following is my implementation :

http://207.58.151.235/~malabarh/newmalabar/privacy.php

regards,
Vipin
Back to top
View user's profile Send private message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Tue Jun 17, 2008 6:17 pm    Post subject: Reply with quote

It's because you are not using a valid license file for your test site.
_________________
Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.
Back to top
View user's profile Send private message
vipinc



Joined: 30 May 2008
Posts: 8

PostPosted: Wed Jun 18, 2008 4:45 am    Post subject: Reply with quote

ah.. the license is valid for the domain not the ip.

thanks.. sry for the trouble
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> FlatCalendarXP Related All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Copyright 2003- Idemfactor Solutions, Inc. All rights reserved.
Powered by phpBB © 2001, 2005 phpBB Group