From 7e6603b0ec87714370193343b1d984b7ca71bbf8 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 28 Nov 2024 13:36:17 +0800 Subject: [PATCH] bugfix --- bricks/bricks.js | 3 +++ bricks/datarow.js | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bricks/bricks.js b/bricks/bricks.js index ac9b146..7751e74 100644 --- a/bricks/bricks.js +++ b/bricks/bricks.js @@ -124,6 +124,9 @@ bricks.widgetBuild = async function(desc, widget, data){ var klassname = desc.widgettype; var base_url = widget.baseURI; while (klassname == 'urlwidget'){ + if (data){ + desc = bricks.apply_data(desc, data); + } let url = bricks.absurl(desc.options.url, widget); base_url = url; let method = desc.options.method || 'GET'; diff --git a/bricks/datarow.js b/bricks/datarow.js index 8bbd31b..4ac9f7d 100644 --- a/bricks/datarow.js +++ b/bricks/datarow.js @@ -35,7 +35,11 @@ bricks.DataRow = class extends bricks.HBox { if (header){ w = new bricks.BlankIcon({}); } else { - w = new bricks.UiCheck({name:this.checkField,value:this.user_data[this.checkField]}); + var v = 0 + if (this.user_data){ + v = this.user_data[this.checkField]; + } + w = new bricks.UiCheck({name:this.checkField,value:v}); w.bind('changed', this.get_check_state.bind(this)); } this.add_widget(w);