using DomHelper to create a table.
do I have to create the tbody and append tr nodes to that?
Code:
var rs = getEl('recordset');
var table = dh.append(rs, {tag: 'table', cls: 'foo'});
var tbody = dh.append(table, {tag: 'tbody'});
does DomHelper::append() append the node immediately to the doc? isn't that inefficient? when creating DOMNodes, are we not supposed to first create a container element, append the children to it, then append the container to the doc, since the teh document object must recalculate everything when a node is appended to it?
eg:
Code:
var container = getEl('container');
var ul = document.createElement('ul');
for (var i=0; i < 10; i++) {
var li = document.createElement('li');
li.appendChild(document.createTextNode(i));
ul.appendChild(li);
}
// finish by appending newly create ul to container
container.appendChild(ul);