[ALOY-1511] Alloy Model-View binding not working for ListItem accessoryType property.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2017-02-23T06:40:54.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Models |
Labels | Alloy, model, view |
Reporter | Narendra Raorane |
Assignee | Eric Merriman |
Created | 2016-07-26T15:05:21.000+0000 |
Updated | 2017-02-23T06:40:54.000+0000 |
Description
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.
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.
Hey Hi @sdarda, I have corrected the query. Also attaching sample .sqlite file. Hope this helps to move forward. Many Thanks! Naren
[~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.