No Data message

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

<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 -->
.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;}

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

var myColumns = [
"Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"

// 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

// 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

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