Page 1 of 2

Manipulating Tiggzi Components with jQuery Mobile

Posted: Thu Apr 12, 2012 9:28 pm
by mcgrathken.kmg

Max

As am extension to your tutorial here:
http://blog.tiggzi.com/2012/03/manipu...
How would I navigate to a new page associated with the newly dynamically created list ?
thank you


Manipulating Tiggzi Components with jQuery Mobile

Posted: Fri Apr 13, 2012 12:24 am
by maxkatz

You can define navigation as always, Click event, then Navigate to Page.


Manipulating Tiggzi Components with jQuery Mobile

Posted: Fri Apr 13, 2012 12:34 am
by mcgrathken.kmg

yes but as it is unknown which list item the user will click how do i overcome this.


Manipulating Tiggzi Components with jQuery Mobile

Posted: Fri Apr 13, 2012 12:37 am
by maxkatz

Is there a separate page for each item in the list?


Manipulating Tiggzi Components with jQuery Mobile

Posted: Fri Apr 13, 2012 12:46 am
by mcgrathken.kmg

lets say from your example, then you don't know how many items are going to be created.how do i link each item in the list to there own separate page


Manipulating Tiggzi Components with jQuery Mobile

Posted: Fri Apr 13, 2012 12:56 am
by maxkatz

You either need to have a page for each link or one page and load its content dynamically (or part of it).


Manipulating Tiggzi Components with jQuery Mobile

Posted: Fri Apr 13, 2012 1:05 am
by mcgrathken.kmg

but the items in the list are created dynamically so i cannot create a link as i don't know how many required.How would I implement the one page option.
Thanks Max


Manipulating Tiggzi Components with jQuery Mobile

Posted: Fri Apr 13, 2012 1:10 am
by maxkatz

As you generate the list, you need to add an id to each item. When you click on the list, you will read the id and know where you clicked and where you need to go.

To change content is runtime, you would need to manipulate the DOM.


Manipulating Tiggzi Components with jQuery Mobile

Posted: Fri Apr 13, 2012 1:30 am
by mcgrathken.kmg

i tried using the following on click event but nothing happens

-------------------------------------------

$('li').each(function(index) {
alert(index + ': ' + $(this).text());
});

-------------------------------------------

Can you offer a better solution


Manipulating Tiggzi Components with jQuery Mobile

Posted: Fri Apr 13, 2012 1:19 pm
by maxkatz

Where exactly did you try it and what is the result? Did you see any error messages in Chrome Developer Tools Console/