import win.ui;
import web.layout
/*DSG{{*/
var winform = ..win.form( right=599;bottom=399;parent=...;text="aardio Form" )
winform.add(
button={ bottom=393;text="添加一行";left=21;top=357;z=2;right=104;cls="button" };
static={ bottom=320;text="static";left=34;top=22;z=1;transparent=1;right=563;cls="static" };
button2={ bottom=395;text="修改一行";left=129;top=354;z=3;right=231;cls="button" }
)
/*}}*/
layout = web.layout( winform.static )
html = /**
<html>
<body>
<table id="myTab">
<tr>1</tr>
<tr>2</tr>
<tr>3</tr>
</table>
</body>
<html>
**/
layout.write(html)
var myTab = layout.getEle("myTab")
winform.button.oncommand = function(id,event){
var newNode = myTab.child(1).clone()
newNode.child(1).innerHTML = "new"
myTab.append(newNode)
}
winform.button2.oncommand = function(id,event){
myTab.child(1).innerHTML = "修改了"
}
winform.show();
win.loopMessage();
想动态添加table的一列,实现listview的控件。克隆了一个节点,然后修改新节点的 innerHTML,但是修改失败。请教下动态添加新节点的方法。谢谢
|