Changeset 22160


Ignore:
Timestamp:
2012/12/26 19:11:39 (11 years ago)
Author:
yomoro
Message:

#1987 データの削除を可能にする。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-multilang/html/js/jquery.ui/ui-datepicker.js

    r22159 r22160  
    33    $( "#datepicker" ).datepicker({ 
    44    beforeShowDay: function(date) { 
    5         //Sunday 
    65        if(date.getDay() == 0) { 
    7             return [true,"date-sunday"]; 
    8         //Saturday    
     6            return [true,"date-sunday"];  
    97        } else if(date.getDay() == 6){ 
    108            return [true,"date-saturday"]; 
    11         //day 
    129        } else { 
    1310            return [true]; 
     
    2017        $("*[name=month]").val(dates[1]); 
    2118        $("*[name=day]").val(dates[2]); 
    22     } 
     19    }, 
     20    showButtonPanel: true, 
     21    beforeShow: showAdditionalButton,        
     22    onChangeMonthYear: showAdditionalButton 
    2323    }); 
    2424}); 
     25 
     26 
     27var showAdditionalButton = function (input) { 
     28    setTimeout(function () { 
     29        var buttonPane = $(input) 
     30                 .datepicker("widget") 
     31                 .find(".ui-datepicker-buttonpane"); 
     32        var btn = $('<button class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" type="button">クリア</button>'); 
     33        btn 
     34                .unbind("click") 
     35                .bind("click", function () { 
     36                    $.datepicker._clearDate(input); 
     37                    $("*[name=year]").val(""); 
     38                    $("*[name=month]").val(""); 
     39                    $("*[name=day]").val(""); 
     40                }); 
     41        btn.appendTo(buttonPane); 
     42    }, 1); 
     43}; 
Note: See TracChangeset for help on using the changeset viewer.