This commit is contained in:
yumoqing 2025-09-26 08:52:43 +08:00
parent 77f81b7328
commit 2e65d0f25b
2 changed files with 6 additions and 21 deletions

View File

@ -127,7 +127,7 @@ bricks.DataViewer = class extends bricks.VBox {
}, },
{ {
name:'clone', name:'clone',
tip:'update selected record', tip:'clone selected record',
selected_row:true, selected_row:true,
icon:this.editable.clone_icon || bricks_resource('imgs/clone.svg') icon:this.editable.clone_icon || bricks_resource('imgs/clone.svg')
}, },
@ -219,13 +219,8 @@ bricks.DataViewer = class extends bricks.VBox {
} }
build_add_form(){ build_add_form(){
var hidefields = []; var hidefields = [];
if (!this.data_params){
this.data_params = {}
}
var opts = this.opts.editor || {};
opts.widgettype = 'Form';
var submit_url = this.editable.new_data_url; var submit_url = this.editable.new_data_url;
opts.options = { var opts= {
submit_url: submit_url, submit_url: submit_url,
width: '100%', width: '100%',
height: '100%' height: '100%'
@ -241,13 +236,8 @@ bricks.DataViewer = class extends bricks.VBox {
} }
build_update_form(data){ build_update_form(data){
var hidefields = []; var hidefields = [];
if (!this.data_params){ var submit_url = this.editable.update_data_url;
this.data_params = {} var opts = {
}
var opts = this.opts.editor || {};
opts.widgettype = 'Form';
var submit_url = this.editable.new_data_url;
opts.options = {
submit_url: submit_url, submit_url: submit_url,
submit_changed:true, submit_changed:true,
width: '100%', width: '100%',
@ -266,13 +256,8 @@ bricks.DataViewer = class extends bricks.VBox {
} }
build_clone_form(data){ build_clone_form(data){
var hidefields = []; var hidefields = [];
if (!this.data_params){
this.data_params = {}
}
var opts = this.opts.editor || {};
opts.widgettype = 'Form';
var submit_url = this.editable.new_data_url; var submit_url = this.editable.new_data_url;
opts.options = { var opts = {
submit_url: submit_url, submit_url: submit_url,
width: '100%', width: '100%',
height: '100%' height: '100%'

View File

@ -347,7 +347,7 @@ bricks.Form = class extends bricks.FormBase {
this.add_widget(filler); this.add_widget(filler);
this.nontextfields = []; this.nontextfields = [];
this.textfields = []; this.textfields = [];
this.options.fields.forEach((f) => { this.fields.forEach((f) => {
if (f.uitype == 'text'){ if (f.uitype == 'text'){
this.textfields.push(f); this.textfields.push(f);
} else { } else {