3.2.0

Row Count is 0

I'm setting grid height based on the number of rows. The problem is that the number of rows turns out to be zero. The data is in an XML file so I'm thinking somehow the data isn't loaded yet or something?!?

anyways....

I have :
var hgt=obj.getRowCount()*60;
    hgt += 45;
    if(hgt>530)
        hgt=530;
    obj.setStyle("height", hgt + "px");



...the row height always turns out to be just 45px. Any way to get around this?
BenS
March 21,
Yes, until the data is loaded (asynchronously by default) the row count should be 0.
Alex (ActiveWidgets)
March 21,
How will i get around this??
Ben
March 22,
Thanks Alex,

Solution for anyone interested:

var defaultResponse = table.response;  
table.response = function(xml){ 
  	defaultResponse.call(this, xml); 

  	//*set grid height
    hgt=table.getCount()*60;
    hgt += 45;
    if(hgt>530)
        hgt=530;
    obj.setStyle("height", hgt + "px");
}


Ben
March 22,

This topic is archived.

See also:


Back to support forum