Using a DataSet as a return type on an Atlas Javascript WebService call
If the WebService you are calling returns a DataSet it may not be obvious how to get to the data in the returned object.
Here is a little example which may help you on your way..
<script language="javascript">
//<!--
function GetNuugget_OnRequestComplete(result)
{
var resultsT = result[0];
var resultRowCount = resultsT.get_length();
for (var i = 0; i < resultRowCount; i++){
alert(resultsT.getItem(0).getProperty("Detail"));
alert(resultsT.getItem(0).getProperty("Creator"));
}
}
//-->
</script>
Notice the DataSet is an array of Table objects. Use the .getItem(rowIndex) method to return the row and the .getProperty(columnName | columnIndex) to access your data.
| Author |
: Paul Hayman |
| Published |
: Friday, 14 July, 2006 |
Paul is the COO of kwiboo ltd consultant and has more than a decade of IT consultancy experience. He has consulted for a number of blue chip companies and has been exposed to the folowing sectors: Utilities, Telecommunications, Insurance, Media, Investment Banking, Leisure, Legal, CRM, Pharmaceuticals, Interactive Gaming, Mobile Communications, Online Services.
Paul is the COO and co-founder of kwiboo (http://www.kwiboo.com/) and is also the creator of GeekZilla.