Grid
TsgcHTMLComponent_Grid — Delphi, C++ Builder 및 .NET에서 정렬, 필터링, CSV/PDF 내보내기, 인라인 편집, 그룹화, 가상 스크롤 및 AI 쿼리를 갖춘 기능이 풍부한 HTML 데이터 그리드입니다.
TsgcHTMLComponent_Grid — Delphi, C++ Builder 및 .NET에서 정렬, 필터링, CSV/PDF 내보내기, 인라인 편집, 그룹화, 가상 스크롤 및 AI 쿼리를 갖춘 기능이 풍부한 HTML 데이터 그리드입니다.
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, Dark 및 CSSClass는 Bootstrap 표 클래스에 매핑됩니다.
ShowSort, ShowFilter, ShowExport(CSV + PDF), EditMode가 있는 InlineEdit 및 ColumnReorder가 클라이언트 측 동작을 추가합니다.
ShowGrouping + GroupByColumn은 그룹 헤더를 렌더링합니다. VisibleRows 및 VirtualScrollURL이 있는 VirtualScroll은 표시될 때 더 많은 행을 로드합니다.
AIQueryEnabled는 질문 바(AIQueryPlaceholder, AIQueryButtonText, AIQueryButtonStyle)를 추가합니다. ProcessAIQuery는 OnAIQuery 이벤트를 발생시킵니다.