Here's a more comprehensive example how to set up a DataGrid to stream
results in real time:
grid = new DataGrid();
grid.columns = [new DataGridColumn("Row1"), new DataGridColumn("Row2")];
grid.dataProvider = new ArrayCollection();
// make the query
var rows_available:int = 0;
token.addEventListener(MySqlEvent.ROWDATA, function(e:MySqlEvent):void {
rs = e.resultSet;
if (rs.first()) {
for (var i:int = 0; i < rows_available; i++) rs.next(); // only tack on
the new rows that just came in
do { grid.dataProvider.addItem( { Row1:
rs.getString("Row1"), Row2: rs.getString("Row2") } );
} while (rs.next());
rows_available = e.rowsAvailable;
}
});
Original issue reported on code.google.com by will.per...@gmail.com on 10 Aug 2008 at 8:37
Original issue reported on code.google.com by
will.per...@gmail.com
on 10 Aug 2008 at 8:37