Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

ListItem itemId Query

$
0
0

I know that in the docs it states that itemId is a string but I have been setting ItemId to be a JSON object.

This works fine on iOS so I can directly reference e.ItemId as a JSON object in the itemClick event of a ListView. But if I do the same thing on Android it will return a string rather than an object.

for example (in an ListItem definition)

properties:{itemId:{id:1, name:'fred', count: 21}}
In the itemClick if I reference e.itemId directly in iOS it is an Object and can be used as such (i.e. itemId.name), but in Android it is a string and referencing itemId.name causes an error.

The funny thing is that if I get a reference to the item directly(similar to)

var item = $.listsection[e.itemIndex];
Then access the properties object of that item then on both iOS and Android it is an object and behalves as such.

I know it states it is a string in the docs, but I just wondered why the difference in the itemClick event on iOS and Android.


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>