码迷,mamicode.com
首页 > 其他好文 > 详细

Easyui datebox单击文本框显示日期选择

时间:2015-05-27 22:53:48      阅读:280      评论:0      收藏:0      [点我收藏+]

标签:easyui   datebox   日期   

Easyui默认是点击文本框后面的图标显示日期,为了更进一步优化体验

修改为单击文本框显示日期选择框

技术分享

修改jquery.easyui.min.js(作者用的是1.3.6版本,其他版本或有区别)

ctrl+f 搜索 "_outerWidth():0" 在本行下面添加如下代码:

// datebox单击文本框出现日期选择 start
if ($(_83f).hasClass("datebox-f")) {
	_844.click(function() {
		_845.click();
	});
}
// end


上下文代码如下:

function _83e(_83f,_840){
var _841=$.data(_83f,"combo");
var opts=_841.options;
var _842=_841.combo;
var _843=_841.panel;
if(_840){
opts.width=_840;
}
if(isNaN(opts.width)){
var c=$(_83f).clone();
c.css("visibility","hidden");
c.appendTo("body");
opts.width=c.outerWidth();
c.remove();
}
_842.appendTo("body");
var _844=_842.find("input.combo-text");
var _845=_842.find(".combo-arrow");
var _846=opts.hasDownArrow?_845._outerWidth():0;

// datebox单击文本框出现日期选择 start
if ($(_83f).hasClass("datebox-f")) {
	_844.click(function() {
		_845.click();
	});
}
// end

_842._outerWidth(opts.width)._outerHeight(opts.height);
_844._outerWidth(_842.width()-_846);
_844.css({height:_842.height()+"px",lineHeight:_842.height()+"px"});
_845._outerHeight(_842.height());
_843.panel("resize",{width:(opts.panelWidth?opts.panelWidth:_842.outerWidth()),height:opts.panelHeight});
_842.insertAfter(_83f);
};

作者:itmyhome

Easyui datebox单击文本框显示日期选择

标签:easyui   datebox   日期   

原文地址:http://blog.csdn.net/itmyhome1990/article/details/46053035

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!