It's me again
(using BANano 1.02)
I have a class ListView:
I have a class ListViewItem:
and i have this code to add items to the ListView:
now i want to iterate over all items in myListView:
However the transpiled JavaScript doesn't iterate over the items but over the ListView:
Thanks in advance & Greetings ... Peter
(using BANano 1.02)
I have a class ListView:
B4X:
Sub Class_Globals
Public Items As List
End Sub
Public Sub Initialize
Items.Initialize
End Sub
Public Sub AddItem(Item As ListViewItem)
Items.Add(Item)
End Sub
I have a class ListViewItem:
B4X:
Sub Class_Globals
Public Text As String
End Sub
Public Sub Initialize
Text = ""
End Sub
and i have this code to add items to the ListView:
B4X:
Dim myListView As ListView
myListView.Initialize
For Counter = 0 To 9
Dim myListViewItem As ListViewItem
myListViewItem.Initialize
myListViewItem.Text = "ListViewItem " & Counter
myListView.AddItem(myListViewItem)
Next
now i want to iterate over all items in myListView:
B4X:
For Each myLVI As ListViewItem In myListView.Items
Log(myLVI.Text)
Next
However the transpiled JavaScript doesn't iterate over the items but over the ListView:
B4X:
// [73] For Each myLVI As ListViewItem In myListView.Items
for (_mylvi in _mylistview) {
// [74] Log(myLVI.Text)
console.log(_mylvi._text);
// [75] Next
}
Thanks in advance & Greetings ... Peter