3.2.0

vertical scrollbar not showing all rows if row height is increased

I need to adjust my grid's row height to 30px, but the vertical scrollbar is not adjusting and drops rows at the bottom from view. Works fine when I don't specify a height.

#myGrid .aw-grid-row { height:30px; font-size: 11px; border: 1px solid #999; }

I'm using version 2.5.2 and the grid is reading dynamic data every few minutes.

Your help is appreciated. thanks!.
Javier
August 13,
I cannot reproduce this. Can you post an example?
Alex (ActiveWidgets)
August 15,
Thanks for your response Alex, it appears to be affecting Firefox 3.0.1
Here's a example, my CSV file has 14 lines and only 9 lines are showing.
(displays okay on IE 6.0)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>ActiveWidgets Examples</title>

<!-- include links to the script and stylesheet files -->
<script src="/private/itc/WIDGETS/runtime/lib/aw.js"></script>
<link rel="stylesheet" href="/private/itc/WIDGETS/runtime/styles/vista/aw.css"></link>

<!-- change default styles, set control size and position -->
<style type="text/css">

#myGrid { height: 300px; width: 940px }

#myGrid .aw-grid-row { height: 30px; font-size: 11px;
border: 1px solid #999; }

#myGrid .aw-row-selector {text-align: center}


</style>
</head>
<body>
<script type="text/javascript">

// create ActiveWidgets data model - CSV text table
var table = new AW.CSV.Table;

// provide data URL - plain text comma-separated file
table.setURL("testfile.csv");

// start asynchronous data retrieval
table.request();

// create ActiveWidgets Grid javascript object
var obj = new AW.UI.Grid;

// assign unique id for the grid element
obj.setId("myGrid");

var columns = ["Alarm", "Status", "Date / Time", "Priority", "dmz", "Host Name", "Message", "Contract"];

// set column labels
obj.setHeaderText(columns);

// number of columns
obj.setColumnCount(8);

obj.setColumnWidth(50, 0); // ALARM
obj.setColumnWidth(40, 1); // STATUS
obj.setColumnWidth(85, 2); // DATE TIME
obj.setColumnWidth(40, 3); // PRIORITY
obj.setColumnWidth(25, 4); // AREA
obj.setColumnWidth(145, 5); // HOST NAME
obj.setColumnWidth(470, 6); // MESSAGE
obj.setColumnWidth(85, 7); // CONTRACT

// enable row selectors
obj.setSelectorVisible(true);
obj.setSelectorText(function(i){return this.getRowPosition(i)+1});
obj.setSelectorWidth(25);

// set row selection
obj.setSelectionMode("single-row");

// assign external 'data model'
obj.setCellModel(table);

// write grid html to the page
document.write(obj);

</script>
</body>
</html>
Javier
August 18,
ok, this looks like a bug in the grid control. The row height is lost during the grid re-initialization when the data arrives. To fix it add the following code -

table.response1 = table.response;
    table.response = function(data){

        var height = obj.getRowHeight();
        this.response1(data);
        obj.setRowHeight(height);
    }
Alex (ActiveWidgets)
August 19,
Thanks Alex, that worked!.
Javier
August 19,
This bug is still present in v2.5.3 using Firefox v3.0.4. The fix provided still works, also.
tmtisfree
January 6,

This topic is archived.

See also:


Back to support forum