TimePicker
TsgcHTMLComponent_TimePicker — renderuje natywne pole wyboru godziny HTML5 z opcjonalnymi granicami min i maks oraz dokładnością co do sekundy, w Delphi, C++ Builder i .NET.
TsgcHTMLComponent_TimePicker — renderuje natywne pole wyboru godziny HTML5 z opcjonalnymi granicami min i maks oraz dokładnością co do sekundy, w Delphi, C++ Builder i .NET.
Opisany etykietą komponent pola, który generuje pole Bootstrap form-control typu HTML5 time. Ustaw granice, a następnie odczytaj właściwość HTML (lub wywołaj statyczną metodę pomocniczą Build).
TsgcHTMLComponent_TimePicker
Natywne pole HTML5 <input type="time">
Delphi, C++ Builder, .NET
Ustaw FieldName, LabelText oraz granice MinTime/MaxTime, a następnie odczytaj HTML — lub wywołaj statyczną metodę pomocniczą Build dla jednej linii kodu.
uses
sgcHTML_Component_TimePicker;
var
oTime: TsgcHTMLComponent_TimePicker;
begin
oTime := TsgcHTMLComponent_TimePicker.Create(nil);
try
oTime.FieldName := 'appointment_time';
oTime.LabelText := 'Appointment time';
oTime.MinTime := '08:00';
oTime.MaxTime := '18:00';
oTime.Required := True;
WebModule.Response := oTime.HTML; // <input type="time">
finally
oTime.Free;
end;
end;
// Or the static one-liner (field name, label, value):
Result := TsgcHTMLComponent_TimePicker.Build('appointment_time', 'Appointment time');
// includes: sgcHTML_Component_TimePicker.hpp
TsgcHTMLComponent_TimePicker *oTime = new TsgcHTMLComponent_TimePicker(NULL);
try
{
oTime->FieldName = "appointment_time";
oTime->LabelText = "Appointment time";
oTime->MinTime = "08:00";
oTime->MaxTime = "18:00";
oTime->Required = true;
String html = oTime->HTML; // <input type="time">
}
__finally
{
delete oTime;
}
// Or the static one-liner:
String html = TsgcHTMLComponent_TimePicker::Build("appointment_time", "Appointment time");
using esegece.sgcWebSockets;
var time = new TsgcHTMLComponent_TimePicker();
time.FieldName = "appointment_time";
time.LabelText = "Appointment time";
time.MinTime = "08:00";
time.MaxTime = "18:00";
time.Required = true;
string html = time.HTML; // <input type="time">
// Or the static one-liner:
string html2 = TsgcHTMLComponent_TimePicker.Build("appointment_time", "Appointment time");
Składniki, po które sięgasz najczęściej.
Value wstępnie wypełnia pole; FieldName ustawia jego atrybut name; LabelText renderuje etykietę form-label.
MinTime i MaxTime ograniczają dostępny zakres za pomocą natywnych atrybutów min/max.
StepSeconds ustawia bezpośrednio atrybut step; ShowSeconds (domyślnie False) to skrót, który wymusza dokładność co do sekundy, gdy StepSeconds pozostaje na 0.
Required i Disabled oznaczają natywne pole.
Size (TsgcHTMLSize: hsExtraSmall…hsExtraLarge, domyślnie hsMedium) odpowiada rozmiarom form-control-sm/form-control-lg z Bootstrap.
Build(fieldName, labelText, value) zwraca znaczniki w jednej linii, bez konieczności zarządzania instancją.
| Pomoc onlinePełna dokumentacja API i przewodnik użytkowania tego komponentu. | Otwórz | |
| Wszystkie komponenty sgcHTMLPrzejrzyj pełną matrycę funkcji 80+ komponentów. | Otwórz | |
| Pobierz bezpłatną wersję próbną30-dniowa wersja próbna zawiera projekty demonstracyjne 60.HTML. | Otwórz | |
| CennikLicencje Single, Team i Site z pełnym kodem źródłowym. | Otwórz |