From 6c536e05b90740c6dbbe3d7539134759c6fb77b1 Mon Sep 17 00:00:00 2001 From: Zeni Kim Date: Mon, 14 Oct 2024 12:19:25 -0500 Subject: [PATCH] base table --- controllers/themedemo.go | 17 ++++++++++++----- storage/templates/custom_theme_formpage.html | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/controllers/themedemo.go b/controllers/themedemo.go index 8a66bc5..1b552b0 100644 --- a/controllers/themedemo.go +++ b/controllers/themedemo.go @@ -113,6 +113,11 @@ func Themeform(c *core.Context) *core.Response { optionc.Name = "citys" optionc.Value = "buenosaires" optionc.Label = "Buenos Aires" + allOptionsc = append(allOptionsc, optionc) + optionc.ID = "sogas" + optionc.Name = "sogas" + optionc.Value = "Sogamoso" + optionc.Label = "Sogamoso" //optionc.IsChecked = true allOptionsc = append(allOptionsc, optionc) @@ -194,13 +199,16 @@ func Themecontent(c *core.Context) *core.Response { th.ID = "ba" th.Value = "Column heading 3" allTh = append(allTh, th) + // for td items var allTd [][]components.ContentTableTD - var vals []components.ContentTableTD + //var vals []components.ContentTableTD // rows - for i := 0; i < 5; i++ { + for i := 1; i <= 10; i++ { + vals := make([]components.ContentTableTD, len(allTh)) for b := 0; b < len(allTh); b++ { - vals[b].Value = fmt.Sprintf("%s%d%d", "TD data: ", b, i) + vals[b].Value = fmt.Sprintf("%s%d%d", "TD data: ", i, b) + vals[b].ID = fmt.Sprintf("%s%d%d", "idtd_", i, b) } allTd = append(allTd, vals) } @@ -208,8 +216,7 @@ func Themecontent(c *core.Context) *core.Response { // now fill data of the components tmplData := templateData{ ContentTable: components.ContentTable{ - ID: "email", - Label: "Email", + ID: "table_demo", AllTH: allTh, AllTD: allTd, }, diff --git a/storage/templates/custom_theme_formpage.html b/storage/templates/custom_theme_formpage.html index 8781da2..f45a558 100644 --- a/storage/templates/custom_theme_formpage.html +++ b/storage/templates/custom_theme_formpage.html @@ -5,7 +5,7 @@
- + form demos
{{template "form_input" .FormText}} {{template "form_input" .FormEmail}}