0

对于我的对话

var dia = new Dialog({
    content: form,
    title: 'Create a new test',
    style: "width: 300px; height: 165px;"
});

我想创建一个“漂亮”的格式化表格。

目前我做这样的事情:

var form = new Form();

form.domNode.appendChild(dojo.doc.createTextNode("Name:"));

new TextBox({
    placeHolder: "Name"
}).placeAt(form.containerNode);

form.domNode.appendChild(dojo.doc.createTextNode("Upload File:"));

new Uploader({ name: "File",
    label: "Select file",
    id: "addDia",
    multiple: false,
    uploadOnSelect: false,
    url: "to/the/ethreal"
}).placeAt(form.containerNode);

new FileList({
   uploader: up
}).placeAt(form.containerNode);

问题:表格任意排列元素。如何实现这样的目标:

"Label text:" TextBox
"Label text:" Uploader
FileList

或垂直排列:

"Label text:"
TextBox
"Label text:" 
Uploader
FileList
4

1 回答 1

0

没有 CSS 是这样的:

var form = new Form();

var p = dojo.create("div", {}, form.domNode); 
p.appendChild(dojo.doc.createTextNode("Name:"));
new TextBox({
  placeHolder: "Name"
}).placeAt(p);

p = dojo.create("p", {}, form.domNode);
p.appendChild(dojo.doc.createTextNode("Upload file:"));
var up = new Uploader({ name: "File",
    label: "Select file",
    id: "addDia",
    multiple: false,
    uploadOnSelect: false,
    url: "to/the/ethreal"
}).placeAt(p);

为了

"Label text:" TextBox
"Label text:" Uploader
于 2013-08-02T17:47:23.350 回答