Actaully not helpfull, I was just being polite :/
How do I use this ? In a function ? What is 'aRow' ?
Heres my code:
---------------
#Css/js declared etc.
var myColumns = ["contact", "cellno"];
var myData = [ ["David", "0841234234"],["Bobby", "0832443534"],
["Uncle Sam", "0742342344"],["Aunt Sally", "0735647589"],
["Stuart", "0731822766"],["David Beckham", "0731231234"],
["Bobbi Skinstad", "0731222726"],["asdasd", "0832233445"],
["another num", "0832706668"],["chop", "0731244578"],
];
var myData3 = [
["Suckass", "0841234234"],["Narf", "0832443534"],
["Biteme", "0742342344"],["Shampoodle", "0735647589"],
["Stuart", "0731822766"],["Oli fis", "0731231234"],
["Naatjie", "0731222726"],["lololo", "0832233445"],
["Zomp", "0832706668"],["Afrtoz", "0731244578"],
];
var myData2 = [];
var obj = new Active.Controls.Grid;
obj.setId("grid1");
obj.setColumnCount(2);
obj.setRowCount(10);
obj.setProperty("selection/multiple", true);
obj.setDataText(function(i, j){return myData[i][j]});
obj.setColumnText(function(i){return myColumns[i]});
obj.setRowHeaderWidth("10px");
obj.setColumnHeaderHeight("20px");
function printRowData(src){
var index = src.getProperty("row/index");
obj2.setProperty("data/text", myData[index]);
obj2.refresh();
}
function addRow(){
var rowData = ["NEW-USER", "0742456431"]
myData.unshift(rowData);
obj.setRowProperty("count", myData.length);
obj.refresh();
}
function removeRow(grid) {
var index = grid.getProperty("selection/index");
if(index != '-1') {
if (confirm("Are you sure you want to delete?")) {
_removeRow(grid, index);
var lastRow = grid.getProperty("row/count");
if(lastRow == 0) addNewRow(grid);
grid.setProperty("selection/index", lastRow-1);
}
} else alert('Error or something.');
}
function argh() {
obj2.getDataText = function(i, j){return myData2[i][j]};
myData2[0] = aRow;
obj2.setDataProperty("count", 1);
obj2.setRowValues([0]);
obj2.refresh();
}
obj.setAction("click", argh);
document.write(obj);
Thanks