mgcolumnview

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2025 License: MIT Imports: 6 Imported by: 0

README

MGColumnView

MGColumnView é um componente customizado para Fyne que exibe dados em formato de tabela, com suporte a cabeçalhos clicáveis, seleção por checkboxes, adição e remoção dinâmica de linhas e ordenação por coluna.

Recursos

  • NewColumnView: Cria um novo columnview com cabeçalhos
  • AddRow: Adiciona item
  • ListSelected: Retorna os itens que foram selecionados
  • ListAll: Retorna todos os itens
  • RemoveSelected: Remove os itens selecionados
  • RemoveAll: Remove todos os itens
  • Ordem Crescente: Em todas as colunas, clicando no cabeçalho
  • Selecionar Todos: Checkbox no cabeçalho

Instalação

go get github.com/mugomes/mgcolumnview

Exemplo

import "github.com/mugomes/mgcolumnview"

headers := []string{"Nome","Idade"}
cv := columnview.NewColumnView(headers)

cv.AddRow([]string{
    "Maria",
    "39",
})

cv.AddRow([]string{
    "João",
    "49",
})

for _, row := range cv.ListAll() {
	fmt.Println(row.ID, row.Data)
}

Information

Requirement

  • Go 1.24.6
  • Fyne 2.7.0

Support

License

Copyright (c) 2025 Murilo Gomes Julio

Licensed under the MIT license.

All contributions to the MGColumnView are subject to this license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnView

type ColumnView struct {
	widget.BaseWidget
	// contains filtered or unexported fields
}

func NewColumnView

func NewColumnView(headers []string, widths []float32, enableCheck bool) *ColumnView

NewColumnView cria o componente com cabeçalhos e dados

func (*ColumnView) AddRow

func (cv *ColumnView) AddRow(row []string)

AddRow

func (*ColumnView) CreateRenderer

func (cv *ColumnView) CreateRenderer() fyne.WidgetRenderer

CreateRenderer implementa o renderer

func (*ColumnView) ListAll

func (cv *ColumnView) ListAll() []SelectRow

Selected retorna todas as linhas que estão marcadas (checkbox = true)

func (*ColumnView) ListSelected

func (cv *ColumnView) ListSelected() []SelectRow

Selected retorna todas as linhas que estão marcadas (checkbox = true)

func (*ColumnView) RefreshBody

func (cv *ColumnView) RefreshBody()

RefreshBody reconstrói apenas o corpo (linhas)

func (*ColumnView) RemoveAll

func (cv *ColumnView) RemoveAll()

func (*ColumnView) RemoveSelected

func (cv *ColumnView) RemoveSelected()

RemoveSelected remove todas as linhas que estão marcadas

func (*ColumnView) UpdateColumnItem added in v1.1.0

func (cv *ColumnView) UpdateColumnItem(rowIndex int, colIndex int, value string)

UpdateColumnItem atualiza o item do indice e da coluna

func (*ColumnView) UpdateItem added in v1.1.0

func (cv *ColumnView) UpdateItem(rowIndex int, value []string)

UpdateItem atualiza todas as colunas do indice

type SelectRow added in v1.1.0

type SelectRow struct {
	ID   int
	Data []string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL