3.2.0

element function not working

I am trying to get a reference to the SPAN object used for each cell to tally up the offsetWidth and adjust the column size appropriately.

var obj = new AW.UI.Grid;
obj.setId("myGrid");


I add the data (no problem there). Then, at the very end of the function, I do this:

for (fixCol=0;fixCol < colCount;fixCol++) {
    var i_width = 0;
    for (checkCell=0;checkCell < rowCount;checkCell++) {
        window.alert(obj.getCellTemplate(fixCol,checkCell).getContent("box/text").element());		
    }
}


... just to see if I get anything as a test. No dice. If I just do:

window.alert(obj.getCellTemplate(fixCol,checkCell).getContent("box/text"));


... I get an output of the SPAN tag associated with the cell. Any attempts to use the "element()" function return "undefined". Any attempts to use the ".offsetWidth" on that undefined element function just error out (obviously). Am I missing something? I've seen references all over the forums regarding the "element()" function, but I don't see where I'm going wrong.

I'm using version 2.5.1. TIA.
Josh
April 28,
Nevermind. I never got it working, but I stole the OP's function from http://www.activewidgets.com/javascript.forum.19561.4/contribution-double-click-header-separator.html and got it working.
Josh
April 28,

This topic is archived.

See also:


Back to support forum