EmptyState
TsgcHTMLComponent_EmptyState — 그리드, 목록 또는 검색 결과에 표시할 행이 없을 때 보여주는 패널로, 아이콘 또는 이미지, 제목, 설명, 최대 두 개의 버튼으로 구성됩니다. Delphi, C++ Builder 및 .NET에서 사용할 수 있습니다.
TsgcHTMLComponent_EmptyState — 그리드, 목록 또는 검색 결과에 표시할 행이 없을 때 보여주는 패널로, 아이콘 또는 이미지, 제목, 설명, 최대 두 개의 버튼으로 구성됩니다. Delphi, C++ Builder 및 .NET에서 사용할 수 있습니다.
Icon, Title, Description을 설정한 다음 HTML 속성을 읽습니다. 스크립트를 전혀 생성하지 않으므로 페이지가 필요로 하는 만큼 자주 대역 외(out-of-band) 조각으로 전송해도 안전합니다.
TsgcHTMLComponent_EmptyState
단일 플레이스홀더 <div>, 스크립트 없음
Delphi, C++ Builder, .NET
Icon은 CSS 아이콘 클래스 또는 인라인 SVG 마크업을 받아들이며, 좁은 범위의 안전성 검사를 거친 후 그대로 출력됩니다. 최종 사용자 입력을 여기에 바인딩하지 말고, 신뢰할 수 없는 텍스트는 항상 HTML로 인코딩되는 Title과 Description에 바인딩하십시오.
uses
sgcHTML_Enums, sgcHTML_Component_EmptyState;
var
oEmpty: TsgcHTMLComponent_EmptyState;
begin
oEmpty := TsgcHTMLComponent_EmptyState.Create(nil);
try
oEmpty.Icon := 'bi bi-inbox';
oEmpty.Title := 'No results';
oEmpty.Description := 'Try a different search, or clear your filters.';
oEmpty.ActionCaption := 'Clear filters';
oEmpty.ActionHref := '/orders';
oEmpty.ActionStyle := bsPrimary;
WebModule.Response := oEmpty.HTML;
finally
oEmpty.Free;
end;
end;
// Or the one-line static helper for the simple case:
WebModule.Response := TsgcHTMLComponent_EmptyState.Build('No results', 'Try a different search.');
// includes: sgcHTML_Component_EmptyState.hpp
TsgcHTMLComponent_EmptyState *oEmpty = new TsgcHTMLComponent_EmptyState(NULL);
try
{
oEmpty->Icon = "bi bi-inbox";
oEmpty->Title = "No results";
oEmpty->Description = "Try a different search, or clear your filters.";
oEmpty->ActionCaption = "Clear filters";
oEmpty->ActionHref = "/orders";
oEmpty->ActionStyle = bsPrimary;
String html = oEmpty->HTML;
}
__finally
{
delete oEmpty;
}
// Or the one-line static helper for the simple case:
String html2 = TsgcHTMLComponent_EmptyState::Build("No results", "Try a different search.");
using esegece.sgcWebSockets;
var empty = new TsgcHTMLComponent_EmptyState();
empty.Icon = "bi bi-inbox";
empty.Title = "No results";
empty.Description = "Try a different search, or clear your filters.";
empty.ActionCaption = "Clear filters";
empty.ActionHref = "/orders";
empty.ActionStyle = ButtonStyle.bsPrimary;
string html = empty.HTML;
// Or the one-line static helper for the simple case:
string html2 = TsgcHTMLComponent_EmptyState.Build("No results", "Try a different search.");
가장 자주 사용하게 되는 멤버.
CSS 아이콘 클래스 또는 인라인 SVG(살균 처리되며, 거부 시 삭제됨)입니다. 둘 다 설정된 경우 ImageURL이 Icon보다 우선합니다.
항상 HTML로 인코딩되므로, 데이터베이스나 사용자가 입력한 텍스트를 바인딩하기에 안전한 한 쌍입니다.
공유 TsgcHTMLButtonStyle 열거형으로 스타일이 지정되는 주요 행동 유도 버튼으로, 기본값은 bsPrimary입니다.
두 번째 버튼으로, 항상 아웃라인 스타일이며 자체 스타일 속성은 없습니다.
전체 페이지/섹션이 아닌 위젯이나 테이블 본문 같은 작은 임베드 영역을 위한 더 좁은 패딩입니다.
클래스 함수로, 임시 인스턴스를 생성하고 Title/Description을 설정한 후 렌더링하고 해제하는 과정을 한 번의 호출로 수행합니다.