I'm glad you guys are watching. I was wondering whether my question was 
considered trivial by everyone but me.

Turns out it is pretty easy to add a callback. I modified the code in 
datePicker.js, as follows.

//Kelvin's code initing datePicker
     changeMonth: function(d, e){
        _drawingMonth = true;
        _draw(_getCalendarDiv(d));
        _drawingMonth = false;

// my addition to this func
       if (this.callback){
          this.callback(d);
          //d is a Date object -- the last day of
         //the requested month, IIRC
        }
      },
        
Now that I notice how brief that changeMonth function is, I suppose it 
would be more efficient just to replace it before applying the 
datePicker, rather than make changes in the plugin itself:

jQuery.datePicker.changeMonth = function(){
   //as above
};

as to the callback:
jQuery.datePicker.callback = function(d)
   // get some data for the month containing
   // date(object) d
        
};

HTH

Bruce




Christopher Jordan said the following on 3/8/2007 3:51 PM:
> I've resorted to writing my own calendar functions (a mix of JS and 
> ColdFusion) because I needed more than just a date picker. I'll watch 
> this thread too, and see where it goes. :o)
> 
> Chris
> 
> Eugene Louw wrote:
>> Hi Bruce,
>>
>> I'm looking for exactly looking for the same thing, I would like to be 
>> able to blank out certain dates and make them not selectable, but also 
>> looking at the calendar as a whole, not just a date picker.
>>
>> I know this is not much help but I will follow this thread closely.
>>
>> Regards,
>> Eugene
>>
>> On 3/5/07, *Bruce McKenzie* < [EMAIL PROTECTED] 
>> <mailto:[EMAIL PROTECTED]>> wrote:
>>
>>     Hello,
>>
>>     I'd like to use the excellent datePicker plugin to make a bigger
>>     calendar that displays summary data from a database for each day
>>     in the
>>     month. I've got it working for the first month that displays, but I
>>     don't know how to display new data when the user clicks on the
>>     previous
>>     month or next month link.
>>
>>     I think what I need to do is either insert a function into
>>     datePicker.js
>>     that makes an Ajax call, then call that function from the built-in
>>     changeMonth function. Or extend jQuery.datePicker with a new
>>     method that
>>     includes changeMonth.
>>
>>     I'm not clear on how to do either -- or whether there's a better way.
>>
>>     Thanks,
>>
>>     Bruce
>>
>>     http://www.2MinuteExplainer.com <http://www.2MinuteExplainer.com>
>>
>>     _______________________________________________
>>     jQuery mailing list
>>     discuss@jquery.com <mailto:discuss@jquery.com>
>>     http://jquery.com/discuss/
>>
>>
>>
>>
>> -- 
>> ------------------------------------------------
>> Eugene Louw
>>
>> Nowhere, South Africa
>> ------------------------------------------------
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> jQuery mailing list
>> discuss@jquery.com
>> http://jquery.com/discuss/
>>   
> 
> -- 
> http://www.cjordan.us
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/

-- 
Bruce McKenzie
Business Information Graphics, Inc.
242 W. 36th Street
10th Floor
New York, NY 10018

v. 212-477-4288
http://www.2MinuteExplainer.com

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to