大家应该都知道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";
		div.style.zIndex = "11111";	
	}
	div.appendChild(table);


粗体是后面加上的。

改后的效果ok。

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


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


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

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


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


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


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

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


我没有找到呀? 能否给个link? yui-ext文档太少。
差沙 2007-04-09
ext自己的日期选择也不错,相对小巧些。。
dengyin2000
搜索本博客
我的相册
4d063000-8eef-365d-8346-f210ccfd5265-thumb
VB-seamless
共 13 张
存档
最新评论