Mark Dahmke
Posts: 0
Joined: Wed Mar 14, 2012 3:51 pm

add items to list

Hi - I've been testing Tiggzi but need a bit of help with a list. I need to be able to dynamically populate and refresh a list. What I'm doing now:

Code: Select all

 var len = results.rows.length; 

$('[name=employeeList]').html('');
for (var i=0; im just not finding it in your examples.

Thanks

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

add items to list

Are you trying to generate a list or just add another item to the list? What kind of list are you using?

Mark Dahmke
Posts: 0
Joined: Wed Mar 14, 2012 3:51 pm

add items to list

Thanks - I need to be able to append items to the list and/or clear it and repopulate the list. I'm using the one that shows up on the palette as "list" with three items labeled 1, 2, 3.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

add items to list

Here is how to add a new item:

code
Tiggr('list')&#46;append('<li>New item<&#47;li>');
Tiggr('list')&#46;listview('refresh');
/code

where 'list' - is the name of the list.

Mark Dahmke
Posts: 0
Joined: Wed Mar 14, 2012 3:51 pm

add items to list

Thanks - that's what I was trying to find. One feature that would be helpful would be a "view source" capability to be able to browse the generated code within a screen (trying to find it through the Chrome developer tool is time-consuming).

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

add items to list

The first line should be this, to make it a link:
code
Tiggr('list')&#46;append('<li><a>New item<&#47;a><&#47;li>');
/code

Using Chrome developer tool (or Firebug) is actually the best way to do it, we use it all the time. I'm sure you know this, but you can right-click any element on the page, and view it in Chrome developer tools (Inspect Element).

Mark Dahmke
Posts: 0
Joined: Wed Mar 14, 2012 3:51 pm

add items to list

Got it figured out... thanks.

I've been using Chrome developer tools but hadn't gotten into the habit of using 'inspect element'... not sure why I didn't think of that earlier :)

Sorry to keep asking basic questions but I haven't done much javascript lately and am still getting up to speed with PhoneGap - I usually build native droid apps.

Return to “Issues”