I have a simple function that loops through all the replicants in my DCR and sets a value for the order. I keep getting the following error message.
"TypeError: str.search is not a functionhttp://bcomcmd1/iw-cc/datacapture/dc_item_serializer_common.jsLine 10"
Has anyone else run into this issue? Thanks.
getChildren() returns an Array, not an Object, so using for..in may lead to weirdness (because "i" would sometimes not be a number). Maybe that has something to do with it.
I thought you use getChildren to iterate into a replicant or container. How else would I loop through all the replicants and set the value for one of the items? Thanks.
JoeS wrote: I thought you use getChildren to iterate into a replicant or container. How else would I loop through all the replicants and set the value for one of the items? Thanks.
Yes, that part is correct. But you're iterating over an array, not an object, so the syntax must be something like:
for (var i=0; i<children.length; i++) { }
With what you've used, it says "iterate over the properties of this object", for which values of "i" will include non-integers such as "length".