-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
table, _ := stable.ToTable(board)
table.GetFieldByName("GroupID").SetOptions(&stable.Options{CharLimit: 8})
table.GetFieldByName("Group").SetOptions(&stable.Options{CharLimit: 8})
table.GetFieldByName("OldGroupID").SetOptions(&stable.Options{Hide: true})
table.SetGeneralPadding(0)
table.SetCaption("Season Users")
fmt.Println(table)
// any change in the "board"
table, _ := stable.ToTable(board)
table.GetFieldByName("GroupID").SetOptions(&stable.Options{CharLimit: 8})
table.GetFieldByName("Group").SetOptions(&stable.Options{CharLimit: 8})
table.GetFieldByName("OldGroupID").SetOptions(&stable.Options{Hide: true})
table.SetGeneralPadding(0)
table.SetCaption("Season Users")
fmt.Println(table)
// ---------------------------------------------------
// proposal:
scheme := stable.Scheme{
FieldOptionsWithName: {
"GroupID": &stable.Options{CharLimit: 8},
"Group": &stable.Options{CharLimit: 8},
"OldGroupID": &stable.Options{Hide: true},
},
DefaultGeneralPadding: 0,
Caption: "Season Users",
}
table, _ := stable.ToTableWithScheme(leaderboard, scheme)
// any change in the "board"
table, _ := stable.ToTableWithScheme(leaderboard, scheme)Need to set all options for all fields over and over again to print the table with same form.
There must be a scheme or options object to merge all settings in to one variable.
Metadata
Metadata
Assignees
Labels
No labels