forked from mbk-lab/rui_orig
2
0
Fork 0

Bug fixing

This commit is contained in:
Alexei Anoshenko 2022-09-07 12:28:58 +03:00
parent a9e0b246d5
commit ed03368f5d
1 changed files with 14 additions and 12 deletions

View File

@ -454,21 +454,23 @@ func (table *tableViewData) set(tag string, value any) bool {
delete(table.properties, tag) 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: case DataNode:
switch value.Type() { switch value.Type() {
case ObjectNode: case ObjectNode:
obj := value.Object() return table.set(tag, 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)
}
case TextNode: case TextNode:
table.properties[tag] = value.Text() table.properties[tag] = value.Text()