:: Forum >>
Get contents of grid
Hi,
How can I loop through the rows in a grid? I want to check if a row exists in the grid before I add it.
I've tried different variations of getCellText, none seems to work. I've tried getCellProperty("text") - doesn't seem to do anything.
I'm adding rows by using setCellText(row, index).
Any hints anyone?
Cheers
Daniel
Tuesday, February 28, 2006
You'll probably want to use a DISTINCT in your SQL select statement to make sure you are only getting one copy of each record. Checking the data every insert with a large dataset would be a real performance drag.
James
Tuesday, February 28, 2006
Hi,
This is pure client-side - I'm just moving rows between two grids and I want the target grid to contain unique rows.
Cheers
Daniel
Wednesday, March 1, 2006
You can request an array of row indices from obj.getRowIndices() - if this method returns null then each row index is equal to row position (not sorted yet).
var obj = new AW.UI.Grid;
obj.setCellText(function(i, j){return j + "." + i});
obj.setHeaderText("header");
obj.setColumnCount(10);
obj.setRowCount(10);
document.write(obj);
var button = new AW.UI.Button;
button.setControlText("Get rows");
document.write(button);
button.onClick = function(){
var i, s = "";
var a = obj.getRowIndices();
for (i=0; i<obj.getRowCount(); i++){
s += " " + (a ? a[i] : i);
}
alert(s);
}
Alex (ActiveWidgets)
Wednesday, March 1, 2006
G. Cayman
Wednesday, March 1, 2006
This topic is archived.
Back to support forum
Forum search