附件 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;
附件 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;