Commit 4ac30a85 by unknown

add the erase date

parent 79662727
......@@ -82,9 +82,9 @@ $(function () {
<label class="control-label" for="theDate">时间</label>
<div class="controls" style="">
<#if id??>
<input id="theDate" name="theDate" value="${form.theDate??}" placeholder="时间" class="datepicker input-medium" required="" type="text" readonly />
<input id="theDate" name="theDate" value="${form.theDate??}" placeholder="时间" class="datepicker input-medium" required="" type="text" />
<#else>
<input id="theDate" name="theDate" value="" placeholder="时间" class="datepicker input-medium" required="" type="text" readonly />
<input id="theDate" name="theDate" value="" placeholder="时间" class="datepicker input-medium" required="" type="text" />
<div class="pp" style="background-image:url(${staticServer}/pic/calendar.jpg);width: 40px;height: 30px;">
</#if>
......
......@@ -11,6 +11,7 @@
* jquery.ui.core.js
*/
var $targetVal;
var targetDateInput;
(function( $, undefined ) {
......@@ -617,11 +618,23 @@ $.extend(Datepicker.prototype, {
//}
//return true;
},
_eraseAllData: function(){
$(".ui-datepicker-calendar").find("a").each(function(){
var action = $(this).attr("action");
if($targetVal.indexOf(action) >= 0){
$(this).css({background:"#e6e6e6"});
$(this).data("picker",{clicked:false});
}
});
},
/* Pop-up the date picker for a given input field.
@param input element - the input field attached to the date picker or
event - if triggered by focus */
_showDatepicker: function(input) {
if(!targetDateInput.val()){
$.datepicker._eraseAllData();
}
input = input.target || input;
if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger
input = $('input', input.parentNode)[0];
......@@ -630,7 +643,7 @@ $.extend(Datepicker.prototype, {
var inst = $.datepicker._getInst(input);
if ($.datepicker._curInst && $.datepicker._curInst != inst) {
$.datepicker._curInst.dpDiv.stop(true, true);
}
}
var beforeShow = $.datepicker._get(inst, 'beforeShow');
extendRemove(inst.settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {}));
inst.lastVal = null;
......@@ -1831,7 +1844,7 @@ $(function(){
$this.append($input);
targetDateInput = $(opts.target);
//$(".picInput").datepicker().change(function(){
$this.find('.picInput').datepicker().change(function(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment