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 // TableView - text View
type TableView interface { type TableView interface {
View View
ParanetView
ReloadTableData() ReloadTableData()
} }
type tableViewData struct { type tableViewData struct {
viewData viewData
cellViews []View
} }
type tableCellView struct { type tableCellView struct {
@ -166,6 +168,7 @@ func newTableView(session Session) View {
func (table *tableViewData) Init(session Session) { func (table *tableViewData) Init(session Session) {
table.viewData.Init(session) table.viewData.Init(session)
table.tag = "TableView" table.tag = "TableView"
table.cellViews = []View{}
} }
func (table *tableViewData) normalizeTag(tag string) string { 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) { func (table *tableViewData) htmlSubviews(self View, buffer *strings.Builder) {
table.cellViews = []View{}
content := table.getRaw(Content) content := table.getRaw(Content)
if content == nil { if content == nil {
return return
@ -556,6 +561,7 @@ func (table *tableViewData) htmlSubviews(self View, buffer *strings.Builder) {
case View: case View:
viewHTML(value, buffer) viewHTML(value, buffer)
table.cellViews = append(table.cellViews, value)
case Color: case Color:
buffer.WriteString(`<div style="display: inline; height: 1em; background-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]) builder.add("vertical-align", enumProperties[TableVerticalAlign].values[value])
} }
} }
func (table *tableViewData) Views() []View {
return table.cellViews
}