在jquery datetimepicker插件中清除按钮

时间:2013-09-30 13:54:36

标签: jquery datepicker datetimepicker

我有datetimepicker插件

每次我选择日期时......清除按钮隐藏....以下是

的代码
$( ".dateTimePicker" ).datetimepicker({
      showButtonPanel: true,
      beforeShow: function( input ) {
        setTimeout(function() {
          var buttonPane = $( input ).datepicker( "widget" ).find( ".ui-datepicker-buttonpane" );          
          $( "<button >", {
            class:"ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all",
            text: "Clear",          
             click: function() {
              input.value="";
            $.datepicker._hideDatepicker();
            }
          }).appendTo( buttonPane );
        }, 1 );
      }
    });

0 个答案:

没有答案