在 XUL 中使用 DOM JavaScript 动态创建复选框
我想在 XUL 中使用 DOM JavaScript 为树值动态创建复选框: 此函数用于获取我的 XUL 树的值:
function choose() {
var tree = document.getElementById('myTodoListTree');
for (var i = 0; i < tree.view.rowCount; i++) {
if (tree.view.getCellValue(i, tree.columns.getColumnAt(0)) == 'true'){
alert(
tree.view.getCellText(i, tree.columns.getNamedColumn("name"))+"\n"+
tree.view.getCellText(i, tree.columns.getNamedColumn("lastname"))+"\n"+
tree.view.getCellText(i, tree.columns.getNamedColumn("gmail"))+"\n"+
tree.view.getCellText(i, tree.columns.getNamedColumn("yahoo"))+"\n"+
tree.view.getCellText(i, tree.columns.getNamedColumn("url"))+"\n"+
tree.view.getCellText(i, tree.columns.getNamedColumn("facebook-id"))
);
var firstName= tree.view.getCellText(i, tree.columns.getNamedColumn("name"));
var lastName= tree.view.getCellText(i, tree.columns.getNamedColumn("lastname"));
var Gmail= tree.view.getCellText(i, tree.columns.getNamedColumn("gmail"));
var Yahoo= tree.view.getCellText(i, tree.columns.getNamedColumn("yahoo"));
var Facebook = tree.view.getCellText(i, tree.columns.getNamedColumn("url"));
var FacebookId = tree.view.getCellText(i, tree.columns.getNamedColumn("facebook-id"));
}
}
return arr;
}
此 mybox,我想在此框中附加动态创建的组框复选框:
I want to create checkbox dynamically using DOM JavaScript in XUL for tree values:
This function is used to get the values of my XUL tree:
function choose() {
var tree = document.getElementById('myTodoListTree');
for (var i = 0; i < tree.view.rowCount; i++) {
if (tree.view.getCellValue(i, tree.columns.getColumnAt(0)) == 'true'){
alert(
tree.view.getCellText(i, tree.columns.getNamedColumn("name"))+"\n"+
tree.view.getCellText(i, tree.columns.getNamedColumn("lastname"))+"\n"+
tree.view.getCellText(i, tree.columns.getNamedColumn("gmail"))+"\n"+
tree.view.getCellText(i, tree.columns.getNamedColumn("yahoo"))+"\n"+
tree.view.getCellText(i, tree.columns.getNamedColumn("url"))+"\n"+
tree.view.getCellText(i, tree.columns.getNamedColumn("facebook-id"))
);
var firstName= tree.view.getCellText(i, tree.columns.getNamedColumn("name"));
var lastName= tree.view.getCellText(i, tree.columns.getNamedColumn("lastname"));
var Gmail= tree.view.getCellText(i, tree.columns.getNamedColumn("gmail"));
var Yahoo= tree.view.getCellText(i, tree.columns.getNamedColumn("yahoo"));
var Facebook = tree.view.getCellText(i, tree.columns.getNamedColumn("url"));
var FacebookId = tree.view.getCellText(i, tree.columns.getNamedColumn("facebook-id"));
}
}
return arr;
}
This mybox, and I want to append the dynamically created groupbox check-boxes in this box:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最后,我学会了如何动态创建元素。
这就是解决方案:这里我动态创建了组框、标题和复选框。
Finally, I have learnt how to create elements dynamically.
This is the solution: Here I have created group-box, caption and check-box dynamically.