forked from mbk-lab/rui_orig
2
0
Fork 0

TableView bug fixing

This commit is contained in:
Alexei Anoshenko 2021-12-07 12:17:23 +03:00
parent 736d30ae7b
commit 89cd7104eb
1 changed files with 10 additions and 0 deletions

View File

@ -139,11 +139,13 @@ const (
// TableView - text View
type TableView interface {
View
ParanetView
ReloadTableData()
}
type tableViewData struct {
viewData
cellViews []View
}
type tableCellView struct {
@ -166,6 +168,7 @@ func newTableView(session Session) View {
func (table *tableViewData) Init(session Session) {
table.viewData.Init(session)
table.tag = "TableView"
table.cellViews = []View{}
}
func (table *tableViewData) normalizeTag(tag string) string {
@ -379,6 +382,8 @@ func (table *tableViewData) htmlTag() string {
}
func (table *tableViewData) htmlSubviews(self View, buffer *strings.Builder) {
table.cellViews = []View{}
content := table.getRaw(Content)
if content == nil {
return
@ -556,6 +561,7 @@ func (table *tableViewData) htmlSubviews(self View, buffer *strings.Builder) {
case View:
viewHTML(value, buffer)
table.cellViews = append(table.cellViews, value)
case Color:
buffer.WriteString(`<div style="display: inline; height: 1em; background-color: `)
@ -856,3 +862,7 @@ func (cell *tableCellView) cssStyle(self View, builder cssBuilder) {
builder.add("vertical-align", enumProperties[TableVerticalAlign].values[value])
}
}
func (table *tableViewData) Views() []View {
return table.cellViews
}