tags:

views:

12

answers:

0

Hi Guys, I want to call this two functions at the same time having the onShow event. Is that ever possible? It's in JavaScript

1st function:

selectColumn: function(picker, inst) {
               var target = $(this);
               picker.find('div.datepick-month th span').each(function() {
                   $('<a href="javascript:void(0)" class="' +
                           this.className + '" title="Select all of these days">' +
                           $(this).text() + '</a>').
                       click(function() {
                           var dates = $('div.datepick-month td:nth-child(' +
                               ($(this).parent().index() + 1) +
                               ') a:not(.datepick-other-month)', picker);
                           dates = dates.map(function(i, elem) {
                               return target.datepick('retrieveDate', this);
                           }).get();
                           //target.datepick('clear').datepick('setDate', dates);
            $.merge(dates, target.datepick('getDate'));
            target.datepick('clear').datepick('setDate', dates);
                       }).
                       replaceAll(this);
               });
           },

2nd function:

 selectWeek: function(picker, inst) {
  var target = $(this);
  picker.find('td.datepick-week span').each(function() {
   $('<a href="javascript:void(0)" class="' +
     this.className + '" title="Select the entire week">' +
     $(this).text() + '</a>').
    click(function() {
     var date = target.datepick('retrieveDate', this);
     var dates = [date];
     for (var i = 1; i < 7; i++) {
      dates.push(date = $.datepick.add($.datepick.newDate(date), 1, 'd'));
     }
     if (inst.get('rangeSelect')) {
      dates.splice(1, dates.length - 2);
     }
     target.datepick('setDate', dates).datepick('hide');
    }).
    replaceAll(this);
  });
 },

So could you guys help me if it is possible? By the way, this is how I call it on my main page:

  <textarea cols = "40" rows = "4" id = "picker"></textarea>
  <!--<input type = "text" cols="40" rows ="4" size="20" id = "picker"/>-->
  <div style = "display:none"><img src="cn.jpg" width="16" height="15" alt="Popup" id = "calImg"/></div>