Unanswered: Dynamically changing DataItem components
I have a DataView with DataItem's, each item has a button.
I would like to change that button's text & color each time it is clicked.
Since I'm only storing the data of the elements that were clicked in localstorage, and all the raw data (elements that were clicked and those that weren't) in a store, I need to:
1. Look in the localstorage to see if each item has been clicked (from the localstorage)
2. Have the controller, listening to the tap event of the button click, update the button's itself (text & color).
I think I need to override some functions in the DataItem's view, but I don't know how to do it.
Basically, what would solve my issue, is giving more advanced behavior to the button, for example:
setText: If(condition) 'Name1' else 'Name2' //Here I can change the text on the button, and maybe the color of it.
Tags for this Thread