Grid

TsgcHTMLComponent_Grid — Delphi, C++ Builder 및 .NET에서 정렬, 필터링, CSV/PDF 내보내기, 인라인 편집, 그룹화, 가상 스크롤 및 AI 쿼리를 갖춘 기능이 풍부한 HTML 데이터 그리드입니다.

TsgcHTMLComponent_Grid

Columns를 정의하고, 행을 추가하고(또는 데이터셋을 바인딩하고), 원하는 인터랙티브 기능을 토글한 다음, HTML 속성을 읽습니다.

컴포넌트 클래스

TsgcHTMLComponent_Grid

렌더링

Bootstrap 5 <table> + 인터랙티브 스크립트

패밀리

데이터 및 표

언어

Delphi, C++ Builder, .NET

열을 정의하고, 행을 추가하고, 렌더링하기

필드마다 Columns.Add 항목을 추가하고, AddRow로 행을 추가하고, ShowSort/ShowFilter/ShowExport를 활성화한 다음, HTML을 읽습니다.

uses
  sgcHTML_Component_Grid;

var
  oGrid: TsgcHTMLComponent_Grid;
begin
  oGrid := TsgcHTMLComponent_Grid.Create(nil);
  try
    oGrid.TableID := 'orders';
    oGrid.Striped := True;
    oGrid.Hover := True;
    oGrid.ShowSort := True;
    oGrid.ShowFilter := True;
    oGrid.ShowExport := True;

    oGrid.Columns.Add.Title := 'Customer';
    oGrid.Columns.Add.Title := 'Country';
    oGrid.Columns.Add.Title := 'Total';

    oGrid.AddRow(['Alfreds', 'Germany', '1,200']);
    oGrid.AddRow(['Around the Horn', 'UK', '1,900']);

    WebModule.Response := oGrid.HTML;   // Bootstrap table + script
  finally
    oGrid.Free;
  end;
end;

// Or bind it straight to a dataset:
oGrid.LoadFromDataSet(qryOrders);
// includes: sgcHTML_Component_Grid.hpp

TsgcHTMLComponent_Grid *oGrid = new TsgcHTMLComponent_Grid(NULL);
try
{
  oGrid->TableID = "orders";
  oGrid->Striped = true;
  oGrid->Hover = true;
  oGrid->ShowSort = true;
  oGrid->ShowFilter = true;
  oGrid->ShowExport = true;

  oGrid->Columns->Add()->Title = "Customer";
  oGrid->Columns->Add()->Title = "Country";
  oGrid->Columns->Add()->Title = "Total";

  oGrid->AddRow(OPENARRAY(String, ("Alfreds", "Germany", "1,200")));
  oGrid->AddRow(OPENARRAY(String, ("Around the Horn", "UK", "1,900")));

  String html = oGrid->HTML;   // Bootstrap table + script
}
__finally
{
  delete oGrid;
}
using esegece.sgcWebSockets;

var grid = new TsgcHTMLComponent_Grid();
grid.TableID = "orders";
grid.Striped = true;
grid.Hover = true;
grid.ShowSort = true;
grid.ShowFilter = true;
grid.ShowExport = true;

grid.Columns.Add().Title = "Customer";
grid.Columns.Add().Title = "Country";
grid.Columns.Add().Title = "Total";

grid.AddRow(new string[] { "Alfreds", "Germany", "1,200" });
grid.AddRow(new string[] { "Around the Horn", "UK", "1,900" });

string html = grid.HTML;   // Bootstrap table + script

주요 속성 및 메서드

가장 자주 사용하게 되는 멤버.

열 및 행

Columns(각 항목은 Title, Name, Width, Align을 가짐); AddRow(values)는 행을 추가합니다. Rows는 탭으로 구분된 백킹 목록을 제공하며, Clear는 이를 비웁니다.

데이터셋 바인딩

LoadFromDataSet은 세 가지 오버로드가 있습니다 — 모든 필드, 명명된 필드 목록 또는 최대 행 제한 — DataSource는 실시간 새로 고침을 구동합니다.

스타일링

Striped, Bordered, Hover, Responsive, DarkCSSClass는 Bootstrap 표 클래스에 매핑됩니다.

인터랙티브 기능

ShowSort, ShowFilter, ShowExport(CSV + PDF), EditMode가 있는 InlineEditColumnReorder가 클라이언트 측 동작을 추가합니다.

그룹화 및 스크롤

ShowGrouping + GroupByColumn은 그룹 헤더를 렌더링합니다. VisibleRowsVirtualScrollURL이 있는 VirtualScroll은 표시될 때 더 많은 행을 로드합니다.

AI 쿼리

AIQueryEnabled는 질문 바(AIQueryPlaceholder, AIQueryButtonText, AIQueryButtonStyle)를 추가합니다. ProcessAIQueryOnAIQuery 이벤트를 발생시킵니다.

계속 살펴보기

모든 sgcHTML 컴포넌트60개 이상의 컴포넌트 전체 기능 매트릭스를 둘러보십시오.
무료 체험판 다운로드30일 체험판에는 60.HTML 데모 프로젝트가 포함됩니다.
가격전체 소스 코드가 포함된 Single, Team 및 Site 라이선스.

시작할 준비가 되셨습니까?

무료 체험판을 다운로드하고 Delphi, C++ Builder 및 .NET에서 웹 UI를 구축하기 시작하십시오.