obj.onCellDoubleClicked = function(event, col, row){
var curChars = 0;
/* Start with the # of characters in the header */
maxChars = myColumns[col].length;
for(var i = 0; i < obj.getRowCount(); i++)
{
/* Get the max # of characters in the column */
curChars = myData[i][col].length;
if(curChars > maxChars) maxChars = curChars;
}
if(maxChars > 0)
{
/* My best guess as to how wide to resize the column based on Tahoma, 8pt font*/
var width = maxChars * 6 + Math.ceil(maxChars / 20);
obj.setColumnWidth(width, col);
}
};
obj.getSeparatorTemplate().setEvent("ondblclick", function(event){
this.raiseEvent("onSeparatorDoubleClicked", event, this.$0);
});
obj.onSeparatorDoubleClicked = function(event, column){
alert(column);
};
This topic is archived.