how to update the dojox.mobile.listitem rightText value
-
18-06-2021 - |
Question
I typically do not develop client-side (in this case, mobile) code, so my apologies in advance for what is most likely a "101" type of question.
I have the following dojox.mobile type hierarchy in my html page... ScrollableView > EdgeToEdgeList > multiple ListItems each w the "moveTo" value populated. The complete app looks and flows exactly as I had hoped, however I cannot figure out how to populate the ListItem rightText of the "parent" (the one that invokes the moveTo transition action) w the selected text value from the ListItem Label of the "child".
In other words, I'm trying to simulate the behavior of the iPhone Settings > WiFi ListItem that shows the name of the router that you choose from the Wi-Fi Networks child page.
I have to believe that I'm overlooking some existing property or event that handles this behavior since this is a somewhat widely used visual design paradigm.
Thank you in advance for your time.
Solution
You must write a little bit of JavaScript code for this:
- connect to the onCheckStateChanged event of the "child" list to know which item was selected; your handler will be called with (item, state) arguments, you are interested in state=true event;
- set the 'rightText' attribute of the "parent" list item to the label of the selected child item.
That should do it.