Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1511] Alloy Model-View binding not working for ListItem accessoryType property.

GitHub Issuen/a
Resolution Date2017-02-23T06:40:54.000+0000
Affected Version/sn/a
Fix Version/sn/a
LabelsAlloy, model, view
ReporterNarendra Raorane
AssigneeEric Merriman


I am trying to add alloy model view binding in Listview and as per my requirement, I need to show checkmark for list items dynamically based on business logic. I tried the below code but it doesn't show me checkmark for listitems (There is no error or warning in console), View ~~~ ~~~ Controller ~~~ var query = "SELECT id, name, CASE WHEN id IN (64) THEN 'Ti.UI.LIST_ACCESSORY_TYPE_CHECKMARK' ELSE 'Ti.UI.LIST_ACCESSORY_TYPE_NONE' END AS actype FROM g_occupation WHERE name LIKE 'S%' LIMIT 20"; console.log(query); occupation.fetch({query: query}); ~~~ I have verified the sql query in SQLitemanger separately and it's giving me expected result. Expected - It should show checkmark for all listitems which has matching id in professionIndex array.


  1. Sharif AbuDarda 2016-08-02

    Hello, The sample code you provided is not sufficient enough. Please provide a full reproducible code that we can test to regenerate the issue. Thanks.
  2. Narendra Raorane 2016-08-03

    Hey Hi @sdarda, I have corrected the query. Also attaching sample .sqlite file. Hope this helps to move forward. Many Thanks! Naren
  3. Feon Sua Xin Miao 2017-02-23

    [~narendra.raorane] the value for accessoryType should be number not text, from the code snippet you included, it seems you are trying to assign the string "Ti.UI.LIST_ACCESSORY_TYPE_CHECKMARK" to accessoryType.

JSON Source