I have a treeview (2008 Q3) and I am trying to change the node height ont he client side. I did nto see a method for doing this so I am just trying to apply a new CSS class to change the height. It is not working though, so what am I doing wrong?
Here is the CSS
.addPartsNode
{
width: 100%;
height: 20px;
vertical-align :top;
padding-top: 0px;
}
.addPartsNodePartInfoShown
{
width: 100%;
height: 40px !Important;
vertical-align :top;
padding-top: 0px;
}
All nodes are set to addPartsNode style to start.
Then I use this JS to change the css class for the node. The var currNode is the Current Treeview Node as set by a mouseover function.
if (currNode != null) {
document.body.style.cursor = 'wait';
var element = currNode.get_element();
var lblStock = $telerik.findElement(element, "lblInStock");
if (lblStock.style.visibility == "hidden")
{
lblStock.innerText="1";
var tblPartInfo = $telerik.findElement(element, "tblPartInfo");
tblPartInfo.style.visibility = "visible";
var tbPartInfo = $telerik.findElement(element, "tbPartNotes");
tbPartInfo.style.visibility = "visible";
currNode.set_cssClass="addPartsNodePartInfoShown"
}
else
{
lblStock.innerText=parseFloat(lblStock.innerText)+1;
}
lblStock.style.visibility = "visible";
document.body.style.cursor = 'default';
}
}
Here is the CSS
.addPartsNode
{
width: 100%;
height: 20px;
vertical-align :top;
padding-top: 0px;
}
.addPartsNodePartInfoShown
{
width: 100%;
height: 40px !Important;
vertical-align :top;
padding-top: 0px;
}
All nodes are set to addPartsNode style to start.
Then I use this JS to change the css class for the node. The var currNode is the Current Treeview Node as set by a mouseover function.
if (currNode != null) {
document.body.style.cursor = 'wait';
var element = currNode.get_element();
var lblStock = $telerik.findElement(element, "lblInStock");
if (lblStock.style.visibility == "hidden")
{
lblStock.innerText="1";
var tblPartInfo = $telerik.findElement(element, "tblPartInfo");
tblPartInfo.style.visibility = "visible";
var tbPartInfo = $telerik.findElement(element, "tbPartNotes");
tbPartInfo.style.visibility = "visible";
currNode.set_cssClass="addPartsNodePartInfoShown"
}
else
{
lblStock.innerText=parseFloat(lblStock.innerText)+1;
}
lblStock.style.visibility = "visible";
document.body.style.cursor = 'default';
}
}