3.2.0

No Data message

Hi,
I've attached a particular scenario encountered below which results in a undefined message being displayed on screen.
Is there anyway you could draw a blank grid with a 'No data found' message???

Thanks a mil for your nhelp


<html>
<head>
<title>ActiveWidgets Grid :: Examples</title>
<style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style>

<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/classic/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>

<!-- grid format -->
<style>
.active-controls-grid {height: 100%; font: menu;}

.active-column-0 {width: 80px;}
.active-column-1 {width: 200px; background-color: threedlightshadow;}
.active-column-2 {text-align: right;}
.active-column-3 {text-align: right;}
.active-column-4 {text-align: right;}

.active-grid-column {border-right: 1px solid threedshadow;}
.active-grid-row {border-bottom: 1px solid threedlightshadow;}
</style>

<!-- grid data -->
<script>
var myData = [];

var myColumns = [
"Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"
];
</script>
</head>
<body>
<script>

// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;

// set number of rows/columns
obj.setRowProperty("count", 20);
obj.setColumnProperty("count", 5);

// provide cells and headers text
obj.setDataProperty("text", function(i, j){return myData[i][j]});
obj.setColumnProperty("text", function(i){return myColumns[i]});

// set headers width/height
obj.setRowHeaderWidth("28px");
obj.setColumnHeaderHeight("20px");

// allow multiple selection
obj.setSelectionProperty("multiple", true);

// define action handler
var message = function(){
window.status = "Grid selection:" +
" latest=" + this.getSelectionProperty("index") +
" full list=" + this.getSelectionProperty("values") +
" (press Ctrl- to select multiple rows)."
}

// assign action handler to grid
obj.setAction("selectionChanged", message);

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

</script>
</body>
</html>
Brian
May 11,
maybe the error occurs because you never specific any real data but you define an array with 20 rows. it will cause the undefined error.
May 11,
If you set the row/count to 0 you should see "No data found' message automatically.
obj.setRowProperty("count", 0);
Alex (ActiveWidgets)
May 11,

This topic is archived.

See also:


Back to support forum