-
How to generate table rows in bulk?
// this is package main
g.Row(g.Table().Columns(
g.TableColumn("nickname"),
g.TableColumn("ID"),
).Rows(
initdata.TableForUserRows...,
).FastMode(true).Freeze(1, 1).Size(326, 263-36)), // this is package initdata
var TableForUserRows []*g.TableRowWidget // this is package service
initdata.Users = append(initdata.Users, user)
var table *g.TableRowWidget
initdata.TableForUserRows = append(initdata.TableForUserRows, table)
length := len(initdata.TableForUserRows) - 1
initdata.TableForUserRows[length] = g.TableRow(
g.Checkbox(initdata.Users[length].Name, &initdata.Users[length].IsSelect).OnChange(func() {
controller.ChangeUsers(length)
}),
g.Labelf("%v", initdata.Users[length].ID),
)
if initdata.Users[length].IsSelect {
initdata.TableForUserRows[length].BgColor(color.RGBA{R: 0xee, G: 0x20, B: 0x20, A: 255})
} |
Beta Was this translation helpful? Give feedback.
Answered by
Arbureva
Aug 7, 2022
Replies: 1 comment
-
I know where the problem lies, g.Row(g.Table().Columns(
g.TableColumn("nickname"),
g.TableColumn("ID"),
).Rows(
initdata.TableForUserRows...,
).FastMode(true).Freeze(1, 1).Size(326, 263-36)),
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Arbureva
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I know where the problem lies,
FastMode(true)
here, but why?