> Could you give us an example how to build a table by changing the DOM
> directly.
Sure:
---------------
(function($) { // use "$" as local alias for jQuery
var table = $("<table />");
$("<tr />").
append("<th>Title</th>").
append("<th>Date</th>").
appendTo(table);
var tiddlers = store.getTaggedTiddlers("foo");
for(var i = 0; i < tiddlers.length; i++) {
var tiddler = tiddlers[i];
var link = createTiddlyLink(null, tiddler.title, true);
var timestamp = tiddler.created.
formatString("YYYY-0MM-0DD 0hh:0mm");
var row = $("<tr />").appendTo(table);
$("<td />").append(link).appendTo(row);
$("<td />").append(timestamp).appendTo(row);
}
table.appendTo(place); // assumes "place" is a DOM element
})(jQuery);
---------------
(I've kept it basic - there are ways to optimize this and to make it
more elegant, but would have made this example more complex.)
-- F.
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/tiddlywiki?hl=en.