This commit is contained in:
yumoqing 2025-08-29 13:56:21 +08:00
parent 73ae110143
commit 4548db55fe

View File

@ -81,7 +81,29 @@ bricks.FormBody = class extends bricks.VScrollPanel {
this.form = form; this.form = form;
this.name_inputs = {}; this.name_inputs = {};
this.fg = new bricks.FieldGroup({}); this.fg = new bricks.FieldGroup({});
this.fg.build_fields(form, this, form.nontextfields) this.fg.build_fields(form, this, form.nontextfields);
this.build_text_fields();
}
build_text_fields(){
this.form.textfields.forEach((f) => {
var labelw = new bricks.Text({
cheight: 2,
otext: f.label || f.name,
i18n: true
}
var txtw = new bricks.UiText({
name:f.name,
css: "filler",
value:f.value
});
var cell = new bricks.VBox({
width: "100%",
height: "45%"
});
cell.add_widget(labelw);
cell.add_widget(txtw);
this.add_widget(cell);
});
} }
create(){ create(){
this.dom_element = this._create('form'); this.dom_element = this._create('form');
@ -319,6 +341,7 @@ bricks.Form = class extends bricks.FormBase {
} }
}); });
this.body = new bricks.FormBody(this, opts); this.body = new bricks.FormBody(this, opts);
/*
if (this.textfields.length > 0){ if (this.textfields.length > 0){
var tp; var tp;
var tp_options = { var tp_options = {
@ -350,8 +373,9 @@ bricks.Form = class extends bricks.FormBase {
tp = new bricks.TabPanel(tp_options); tp = new bricks.TabPanel(tp_options);
filler.add_widget(tp); filler.add_widget(tp);
} else { } else {
filler.add_widget(this.body);
} }
*/
filler.add_widget(this.body);
if (! opts.notoolbar) if (! opts.notoolbar)
this.build_toolbar(this); this.build_toolbar(this);
} }