Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieving data island field names sample code
Message
De
10/08/2001 12:57:24
 
 
À
10/08/2001 11:54:27
Information générale
Forum:
Internet
Catégorie:
Javascript
Divers
Thread ID:
00542328
Message ID:
00542379
Vues:
16
This message has been marked as the solution to the initial question of the thread.
>UT destroys the html code in my previous message, so I post it again.
>to run it, make the following modifications:
>
>1. replace [ with <
>2. replace ] with >
>
>
>
>[html][body]
>
>[xml id="result" javaDSOCompatible="true"]
>[mytable xmlns:dt="urn:schemas-microsoft-com:datatypes"]
>[row]
>	[field1  dt:dt="string"]value1[/field1]
>[/row]
>[/mytable]
>[/xml]
>
>[script]
>
>// this returns 2
>alert( 'Field count ' + result.recordset.Fields.Count );
>
>// this for loop is not executed! Why?
>for ( f in result.recordset.Fields )
>       alert( 'Field name ' + f.Name );
>[/script]
>[/body][/html]
>
You need to use an enumerator object as explained in the following link (enumerating collections entry) : http://msdn.microsoft.com/scripting/default.htm?/scripting/jscript/techinfo/jsfaq.htm

You would replace it with something like these:
for ( var myenum = new Enumerator(result.recordset.Fields) ; !myenum.atEnd() ; myenum.moveNext() )
	f = myenum.item();
	alert('Field name ' + f.name);
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform