`
dengyin2000
  • 浏览: 1212771 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

jscalendar日期选择框在yui-ext的dialog中的显示问题。

阅读更多
大家应该都知道jscalendar这个日期选择框吧。 当在yui-ext中的dialog使用时,大家应该会想到会发生什么吧。日期选择框在变灰的背景后面。如下图:



大家都应该知道引起这个问题的原因是dialog的z-index比日期选择框的大。ok。我们只要让日期选择框的z-index比dialog还要大就ok。。

修改 calendar.js代码。 让在创建日期选择框的div时加上z-index属性.

Calendar.prototype.create = function (_par) {
	var parent = null;
	if (! _par) {
		// default parent is the document body, in which case we create
		// a popup calendar.
		parent = document.getElementsByTagName("body")[0];
		this.isPopup = true;
	} else {
		parent = _par;
		this.isPopup = false;
	}
	this.date = this.dateStr ? new Date(this.dateStr) : new Date();

	var table = Calendar.createElement("table");
	this.table = table;
	table.cellSpacing = 0;
	table.cellPadding = 0;
	table.calendar = this;
	Calendar.addEvent(table, "mousedown", Calendar.tableMouseDown);

	var div = Calendar.createElement("div");
	this.element = div;
	div.className = "calendar";
	if (this.isPopup) {
		div.style.position = "absolute";
		div.style.display = "none";
		[b]div.style.zIndex = "11111";[/b]	
	}
	div.appendChild(table);


粗体是后面加上的。

改后的效果ok。


分享到:
评论
6 楼 cozone_柯中 2007-04-09  
dengyin2000 写道
cozone_柯中 写道
jscalendar这个日期选择对 具体时间的选择和操作不方便


cozone_柯中 写道
jscalendar这个日期选择对 具体时间的选择和操作不方便


jscalendar有对time的选择。看下面的demo

http://www.dynarch.com/demos/jscalendar/


我的意思是,选择具体的time不方便,回退的时候还要 按下 shift ..还有 不能 自己输入时间
5 楼 dengyin2000 2007-04-09  
cozone_柯中 写道
jscalendar这个日期选择对 具体时间的选择和操作不方便


cozone_柯中 写道
jscalendar这个日期选择对 具体时间的选择和操作不方便


jscalendar有对time的选择。看下面的demo

http://www.dynarch.com/demos/jscalendar/
4 楼 cozone_柯中 2007-04-09  
jscalendar这个日期选择对 具体时间的选择和操作不方便
3 楼 dengyin2000 2007-04-09  
是不是grid中的DateEditor??
2 楼 dengyin2000 2007-04-09  
差沙 写道
ext自己的日期选择也不错,相对小巧些。。


我没有找到呀?  能否给个link? yui-ext文档太少。
1 楼 差沙 2007-04-09  
ext自己的日期选择也不错,相对小巧些。。

相关推荐

Global site tag (gtag.js) - Google Analytics