Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

adam8797

macrumors newbie
Original poster
Jun 13, 2009
7
0
I am writing a iphone website and for a navigation menu i want to use a static list. I have searched EVERYWHERE and cant find anything on the topic. I have attached the outline of the website.

to recap:

(1) I want to use a static menu as the navigation menu.
(2) each entry should link to another view of the stack layout.

I dont care if its dynamic or static but static seemed like the obvious choice.


Thanks in advance,
Adam
 

Attachments

  • Screen shot 2010-06-01 at 4.10.37 PM.png
    Screen shot 2010-06-01 at 4.10.37 PM.png
    31.7 KB · Views: 60
just found a way

Hello Adam!

I'm a newcomer to dashcode, and had the same problem just today.
Well, I did a little hit and miss job through the debug, ended up with the following code:

Code:
function showOption(event){
    // Menu points to the static list that comprises the menu.
    var menu  = dashcode.getDataSource("listMenu");  
    // idx points to the current rowIndex (disabled multi selection).
    var idx     = menu.__selectionIndexes[0];
    // The "theOption" object is an array that holds the key/value pair (label/value).
    // Value is set to the name of the layer.
    var theOption = menu.__content[idx][1];
    
    newTransition = new Transition(Transition.NONE, 0.0, Transition.EASE_TIMING);
    //change foreground of the stack according to theOption
    document.getElementById("stackLayout").object.setCurrentViewWithTransition(theOption, newTransition, false);
}

For the uglyness of this code, I feel its not the correct/best solution, but had not the time to investigate a "valueForKey' approach but, nonetheless, it worked. Set it for the "onClick" method on your listRowTemplate1 object.



Hope it helps!

Best regards,

Zago
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.