Antonia Warren
Posts: 0
Joined: Mon Nov 26, 2012 11:36 pm

Searching for more info on UI elements and building dynamic table

I want to build a table dynamically. How can I append to a table?

Secondly where can I find more information on the options that are available on elements? For instance, the tutorial (http://docs.tiggzi.com/tutorials/buil...) uses dropDown.append() and dropDown.selectmenu('refresh') where dropDown is a select menu. Where can I find more info for tables, lists, buttons and so forth so I can know what operations can be performed on them?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Searching for more info on UI elements and building dynamic table

Hello! Components available in Tiggzi are the standard jQuery Mobile components plus HTML5 components such as Audio/Video, Panel. Unfortunatelly I'm not aware how to append to a table. Please try to check JQM docs.

Antonia Warren
Posts: 0
Joined: Mon Nov 26, 2012 11:36 pm

Searching for more info on UI elements and building dynamic table

Thanks.
I found this little solution on http://stackoverflow.com/questions/23... on how to append to tables. Can you tell me how I translate it to Tiggzi?

$(function() {
var tbl = $('').attr({ id: "bob" });
var row = $('').attr({ class: ["class1", "class2", "class3"].join(' ') }).appendTo(tbl);
$('').text("text1").appendTo(row);
$('').text("Test22").prepend($('a rel="nofollow"/a').attr({ href: "#" }).text("LINK")).appendTo(row);
tbl.appendTo($(".somePlaceInHtml"));
});

Also, I'm trying to add an item to a list using this code

Tiggr('unitsList').append('New item'); //unitsList is the name of the list item on the UI.

to add a new item to a list but it doesn't work properly. Instead of adding a new item to the list, it adds the item as a new line in the list.
Can u help me here as well?

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

Searching for more info on UI elements and building dynamic table

Not much to translate.. you would run the code on page load or, click, or any other event. You should look at the source code generated (when testing the app in browser) as most likely you will need to update the code in your example.

As for adding a new item to the list, you should be able to find many examples online. You will also need to refresh the list - that's how jQuery Mobile works.

http://jquerymobile.com/demos/1.2.0/d...

In general, this will require some JavaScript programming...

Return to “Issues”