-
10 Oct 2011 5:19 AM #1
Answered: NestedList change toolbartitle of detailcard
Answered: NestedList change toolbartitle of detailcard
Hey,
I created a nestedList using the example code...
It looks fine, I only want to change one thing: when I get to the detailcard, the title of the toolbar changes back to the very first one (in the example it changes back to 'music'), but instead I want it to change to the text of the last tapped item.
To clarify:
if this is the nested list:
Music -> Artists -> Artist 1, Artist 2, ...
when artist 2 is tapped, the detailcard appears with 'music' in the toolbar, instead i want it to say 'artist 2'.
Here's my getDetailCard code:
Code:getDetailCard: function(item, parent) { var itemData = item.attributes.record.data, parentData = parent.attributes.record.data, detailCard = new Ext.Panel({ scroll: 'vertical', styleHtmlContent: true, tpl: ["<div>{content}</div>","<div class='centre'><img src='{fronturl}' class='{detailcls}'/></div>"] }); detailCard.update(itemData); this.backButton.setText(parentData.text); return detailCard; },
Thanks!
-
Best Answer Posted by bassjobsen
You can do:
Code:this.backButton.setText(parentData.text); this.title = itemData.text; return detailCard;
-
10 Oct 2011 7:27 AM #2
You can do:
Code:this.backButton.setText(parentData.text); this.title = itemData.text; return detailCard;
-
14 Dec 2011 4:12 AM #3
This solution still has problems unfortunately...
...it does change the title of the toolbar on the detailcard...
HOWEVER, as you tap back to the root of the list, the title bar will update as usual to reflect the current list category, UNTIL it reaches the root, where the title will bizarrely revert back to the title of the detailcard, instead of, say MUSIC (as in this case).
I've noticed that Sencha Touch 2 NestedList seems to work ok in the demo - the detailcard does reflect the relevant title.
So:
- is there a solution for ST1?
- or should I work with ST2? Maybe too early for ST2?
Any legends who can advise?
Thank you!


Reply With Quote