Search code examples
javascripttitaniumtitanium-alloy

Titanium- JavaScript : How to set check mark of a particular row if the values of row existed in a selected array


I was very new to titanium and java script

I have populated a table view with an array myArray

as follows

$.table.setData(myArray);

in that myArray contains JSon formatted values like (title:value1, title:value2)

And i have an another array 'selectedArray' of selected values

Now i need to check each row values that it was existed in 'selectedArray' or not

if it was already existed in 'selectedArray' then we need to disply a check marK

how to achieve this can any one help me


Solution

  • There are 2 basic ways:

    1. You can maintain single array and add a field named selected (true/false)
    2. While adding the elements to myArray you can check for same element in selectedArray and add checkmark accordingly