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 

How to perform a specific action when a date is clicked?

 
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> CalendarXP F.A.Q.
View previous topic :: View next topic  
Author Message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Tue Feb 15, 2005 4:37 pm    Post subject: How to perform a specific action when a date is clicked? Reply with quote

Let's suppose you want to perform the alert() function.

If you want to perform it just before the date gets selected, you need to put it into the fOnChange() callback plugin in the plugins.js file, as following:
Code:
function fOnChange(y,m,d) {
  if (d>0) alert([y,m,d]+' will be selected.');
  return false; // return true to cancel the change.
}

If you want to perform it just after the date gets selected, you need to put it into the fAfterSelected() callback plugin in the plugins.js file, as following:
Code:
function fAfterSelected(y,m,d) {
  gContainer.document.forms[0].inputField.value=y+'-'+m+'-'+d+' has been selected.';
}

Note: the gContainer prefix is required whenever you want to access objects or functions in the containing page from within the plugins. e.g.
Code:
gContainer.myFunction()


The pre-defined popup() function in plugins.js can also be used to open up any URL in the current window or a new window. e.g.
Code:
function fAfterSelected(y,m,d) {
  popup('http://www.calendarxp.net', '_top');
}

Or even startup your email client by using "mailto". e.g.
Code:
function fAfterSelected(y,m,d) {
  popup('mailto:who@email.address?subject=hello there', '_blank');
}

_________________
Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.
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 -> CalendarXP F.A.Q. 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