dhtmlxgrid cell采用 模态窗口输入数据

附件 eXcell_popWin.rar 是定义的 eXcell_popWin
附件 dhtmlxgrid-ModalWinDialog.rar 是整个例子的文件


参考
http://www.iteye.com/topic/73776 如何给dhtmlxgrid加弹出窗口 <BR> http://www.iteye.com/topic/320483 扩展eXcell 实现多个超级链接


大致思路:
<1>先定一个用于dhtmlxgrid弹出窗口用的eXcell,也就是 eXcell_popWin,参考eXcell_popWin.js
<2>定义dhtmlxgrid使用的xml文件:grid2.xml ,参考附件图片 image1.jpg
<3>定义主页面:oWin2.html 参考 附件图片 image2.jpg
<4>定义弹出窗口页面:win2.html 参考 附件图片 image3.jpg

/***----------------------------------------------------------*****/

1.定义相应eXcell:eXcell_popWin
/*********
主题:如何给dhtmlxgrid加弹出窗口
@see http://www.iteye.com/topic/73776
@see http://www.iteye.com/topic/320483

example
<cell>myvalue^http://news.sina.com.cn^select</cell>
*******/


function eXcell_popWin(cell)
{
var cellVal="";
try
{
this.cell = cell;
this.grid = this.cell.parentNode.grid;
}catch(er){}



this.getValue = function(){
var valsAr = this.cell.val.split("^");
return valsAr[0];
}



this.setValue = function(val){
var valsAr = val.split("^");
if(valsAr.length==1)
valsAr[0] = "";

var popMethod = valsAr[1];
this.cell.val = val;
var rowid = this.cell.parentNode.idd;
var colIdx = this.cell._cellIndex;

//alert('rowid=' + rowid +",colIdx=" +colIdx);
//alert('popMethod' +popMethod);

popMethod = popMethod + "(" + rowid + "," + colIdx+ ")";
//alert('popMethod' +popMethod);
var buttonLabel = '...';

if(valsAr[2]){
buttonLabel = valsAr[2];
}

this.cell.buttonLabel = buttonLabel;

var div ="<div>" +valsAr[0] +" <input type='button' value='" + buttonLabel + "' οnclick='" + popMethod + "'>" + "</div>";
//alert('div' +div);
this.cell.innerHTML = div;
this.cell.link = valsAr[1];
}

this.getLink =function (){
return this.cell.link;
}

this.getButtonLabel = function (){
return this.cell.buttonLabel;
}
}


eXcell_popWin.prototype = new eXcell;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值