From ed03368f5d2c3d4267cd95b9501d742bd66361f7 Mon Sep 17 00:00:00 2001 From: Alexei Anoshenko Date: Wed, 7 Sep 2022 12:28:58 +0300 Subject: [PATCH] Bug fixing --- tableView.go | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/tableView.go b/tableView.go index 49151d2..8d68849 100644 --- a/tableView.go +++ b/tableView.go @@ -454,21 +454,23 @@ func (table *tableViewData) set(tag string, value any) bool { delete(table.properties, tag) } + case DataObject: + params := Params{} + for k := 0; k < value.PropertyCount(); k++ { + if prop := value.Property(k); prop != nil && prop.Type() == TextNode { + params[prop.Tag()] = prop.Text() + } + } + if len(params) > 0 { + table.properties[tag] = params + } else { + delete(table.properties, tag) + } + case DataNode: switch value.Type() { case ObjectNode: - obj := value.Object() - params := Params{} - for k := 0; k < obj.PropertyCount(); k++ { - if prop := obj.Property(k); prop != nil && prop.Type() == TextNode { - params[prop.Tag()] = prop.Text() - } - } - if len(params) > 0 { - table.properties[tag] = params - } else { - delete(table.properties, tag) - } + return table.set(tag, value.Object()) case TextNode: table.properties[tag] = value.Text()