DataTable

TsgcHTMLComponent_DataTable — uma tabela de dados de nível superior que envolve um Grid e Pagination dentro de um card com uma barra de ferramentas de busca, seletor de tamanho de página, botão de exportação e contagem de linhas, em Delphi, C++ Builder e .NET.

TsgcHTMLComponent_DataTable

Vincule um dataset, defina um tamanho de página e opções da barra de ferramentas e então leia a propriedade HTML — o Grid e o Pagination internos ficam expostos se você precisar de controle mais fino.

Classe do componente

TsgcHTMLComponent_DataTable

Renderiza

Card Bootstrap 5 com barra de ferramentas, <table> + paginação

Família

Dados & Tabelas

Linguagens

Delphi, C++ Builder, .NET

Vincule um dataset, defina a barra de ferramentas, renderize

Defina um Title e flags da barra de ferramentas, chame LoadFromDataSet com um tamanho de página e então leia HTML. Acesse o Grid interno para ajustar as colunas.

uses
  sgcHTML_Component_DataTable;

var
  oTable: TsgcHTMLComponent_DataTable;
begin
  oTable := TsgcHTMLComponent_DataTable.Create(nil);
  try
    oTable.Title := 'Customers';
    oTable.ShowSearch := True;
    oTable.ShowExport := True;
    oTable.ShowRowCount := True;
    oTable.SearchPlaceholder := 'Search customers...';

    oTable.Grid.Striped := True;
    oTable.LoadFromDataSet(qryCustomers, 25);

    WebModule.Response := oTable.HTML;   // card + table + pagination
  finally
    oTable.Free;
  end;
end;
// includes: sgcHTML_Component_DataTable.hpp

TsgcHTMLComponent_DataTable *oTable = new TsgcHTMLComponent_DataTable(NULL);
try
{
  oTable->Title = "Customers";
  oTable->ShowSearch = true;
  oTable->ShowExport = true;
  oTable->ShowRowCount = true;
  oTable->SearchPlaceholder = "Search customers...";

  oTable->Grid->Striped = true;
  oTable->LoadFromDataSet(qryCustomers, 25);

  String html = oTable->HTML;   // card + table + pagination
}
__finally
{
  delete oTable;
}
using esegece.sgcWebSockets;

var table = new TsgcHTMLComponent_DataTable();
table.Title = "Customers";
table.ShowSearch = true;
table.ShowExport = true;
table.ShowRowCount = true;
table.SearchPlaceholder = "Search customers...";

table.Grid.Striped = true;
table.LoadFromDataSet(qryCustomers, 25);

string html = table.HTML;   // card + table + pagination

Principais propriedades & métodos

Os membros que você usa com mais frequência.

Vinculação a dataset

LoadFromDataSet(aDataSet, aPageSize) preenche o grid interno e define a paginação a partir da contagem de registros; DataSource aciona uma atualização ao vivo.

Barra de ferramentas

ShowSearch com SearchPlaceholder e SearchAction, ShowExport, ShowPageSize com PageSizes e um título Title compõem a barra de ferramentas.

Rodapé

ShowRowCount imprime o resumo de linhas visíveis ao lado do controle de paginação na parte inferior do card.

Grid interno

Grid expõe o TsgcHTMLComponent_Grid completo — defina Striped, Bordered, colunas, ordenação/filtro e mais diretamente nele.

Paginação

Pagination expõe a instância TsgcHTMLComponent_Pagination para CurrentPage, PageSize e TotalItems.

Layout

TableID identifica o card e a tabela interna; ToolbarClass substitui as classes padrão da linha da barra de ferramentas.

Continue explorando

Todos os Componentes sgcHTMLExplore a matriz completa de recursos com mais de 60 componentes.
Baixar Versão de Avaliação GratuitaA avaliação de 30 dias inclui os projetos de demonstração 60.HTML.
PreçosLicenças Single, Team e Site com código-fonte completo.

Pronto para Começar?

Baixe a versão de avaliação gratuita e comece a construir UIs web em Delphi, C++ Builder e .NET.