data_table_action.go 548 B

1234567891011121314151617181920212223242526
  1. package builder
  2. type DataTableActionRow struct {
  3. Icon string
  4. Href string
  5. Hint string
  6. Target string
  7. Classes string
  8. }
  9. func DataTableAction(data *[]DataTableActionRow) string {
  10. result := ``
  11. for _, row := range *data {
  12. target := ``
  13. if row.Target != "" {
  14. target = ` target="` + row.Target + `"`
  15. }
  16. classes := row.Classes
  17. if classes != "" {
  18. classes = " " + classes
  19. }
  20. result += `<a class="ico` + classes + `" title="` + row.Hint + `" href="` +
  21. row.Href + `"` + target + `>` + row.Icon + `</a>`
  22. }
  23. return result
  24. }