var expandColumn = 1; // the column to copy in the expanded part
var expandHeight = "70px"; // the height of the expanded part
function expandFunction (src) {
var id = this.getId()
var row = src.getProperty("item/index")
expandRow(this.getId() , src.element().id, src.getProperty("item/index"), expandColumn, expandHeight, myData);
}
//****************************
function expandRow(id, rowid, row, column, height, data){
var expa = document.getElementById(rowid);
if(expa.getAttribute("openRow")=="1"){ // shrink
expa.setAttribute("openRow","0");
expa.style.height = "";
expa.removeChild(document.getElementById("exp_"+row));
}else{ // expand
expa.setAttribute("openRow","1");
expa.style.height = "auto";
var pX = document.createElement("DIV");
pX.id = "exp_"+row;
pX.innerHTML = data[row][column]+"<br>additional<br>blabla<br><br>blabla<br>blabla<br>blabla<br>blabla"; // the data
// either assigning a pX.className = "" or the hard way:
pX.style.border = "solid 1px #DDDDDD";
pX.style.overflow = "auto";
pX.style.width = "400px";
pX.style.height = height;
pX.style.marginLeft = "10px";
expa.appendChild(pX);
}
document.getElementById(id+".left.item:"+row).style.height = expa.offsetHeight;
}
//****************************
var row = new Active.Templates.Row;
row.setEvent("onclick", function(){this.action("expandAction")});
obj.setTemplate("row", row);
obj.setAction("expandAction", expandFunction);
var pX = document.createElement("DIV");
var pX = document.createElement("IFRAME");
pX.setAttribute("src", "extradata.php?row="+row);
This topic is archived.