Class NumberField<T>
Represents a number field in Trinity framework.
public class NumberField<T> : TrinityField<NumberField<T>, T>, ITrinityComponent, ITrinityField, IFormComponent
Type Parameters
T
- Inheritance
-
TrinityComponent<NumberField<T>, T>TrinityField<NumberField<T>, T>NumberField<T>
- Implements
- Inherited Members
Constructors
NumberField(string)
public NumberField(string columnName)
Parameters
columnName
string
Properties
ButtonLayout
Gets or sets the layout of the increment and decrement buttons.
public string? ButtonLayout { get; protected set; }
Property Value
ComponentName
The component name in the front-end side.
public override string ComponentName { get; }
Property Value
Currency
Gets or sets the currency symbol of the number field component.
public string? Currency { get; protected set; }
Property Value
CurrencyDisplay
Gets or sets the display format of the currency symbol of the number field component.
public string? CurrencyDisplay { get; protected set; }
Property Value
DecrementButtonClassName
Gets or sets the CSS class name for the decrement button.
public string? DecrementButtonClassName { get; protected set; }
Property Value
DecrementButtonIcon
Gets or sets the icon class name for the decrement button.
public string? DecrementButtonIcon { get; protected set; }
Property Value
FormatMode
Gets or sets the format mode of the field.
public string FormatMode { get; protected set; }
Property Value
IncrementButtonClassName
Gets or sets the CSS class name for the increment button.
public string? IncrementButtonClassName { get; protected set; }
Property Value
IncrementButtonIcon
Gets or sets the icon class name for the increment button.
public string? IncrementButtonIcon { get; protected set; }
Property Value
InputPrefix
Gets or sets the input prefix of the number field component.
public string? InputPrefix { get; protected set; }
Property Value
InputSuffix
Gets or sets the input suffix of the number field component.
public string? InputSuffix { get; protected set; }
Property Value
Max
Gets or sets the maximum value of the number field component.
public int? Max { get; protected set; }
Property Value
- int?
MaxFractionDigits
Gets or sets the maximum fraction digits of the field.
public int? MaxFractionDigits { get; protected set; }
Property Value
- int?
Min
Gets or sets the minimum value of the number field component.
public int? Min { get; protected set; }
Property Value
- int?
MinFractionDigits
Gets or sets the minimum fraction digits of the field.
public int? MinFractionDigits { get; protected set; }
Property Value
- int?
ShowButtons
Gets or sets a value indicating whether to display increment and decrement buttons.
public bool ShowButtons { get; protected set; }
Property Value
ShowIcon
Gets or sets a value indicating whether to show icon in the field.
public bool ShowIcon { get; protected set; }
Property Value
Step
Gets or sets the step value used for incrementing or decrementing the value of the field.
public float? Step { get; protected set; }
Property Value
Methods
SetCurrency(string, CurrencyDisplayTypes)
Sets the currency symbol and display format of the number field component.
public NumberField<T> SetCurrency(string currency, CurrencyDisplayTypes display = CurrencyDisplayTypes.Symbol)
Parameters
currency
stringThe currency symbol to be set.
display
CurrencyDisplayTypesThe display format of the currency symbol to be set.
Returns
- NumberField<T>
The current NumberField<T> instance.
SetDecrementButton(string, string)
Sets the class name and icon for the decrement button of the number field.
public NumberField<T> SetDecrementButton(string decrementButtonClassName = "p-button-danger", string decrementButtonIcon = "pi pi-minus")
Parameters
decrementButtonClassName
stringThe class name for the decrement button. Default is "p-button-danger".
decrementButtonIcon
stringThe icon for the decrement button. Default is "pi pi-minus".
Returns
- NumberField<T>
The current instance of the NumberField<T> class.
SetFormatMode(FormatModeTypes)
Sets the format mode of the field.
public NumberField<T> SetFormatMode(FormatModeTypes mode = FormatModeTypes.Decimal)
Parameters
mode
FormatModeTypesThe format mode type.
Returns
- NumberField<T>
The current NumberField<T> instance.
SetIncrementButton(string, string)
Sets the CSS class name and icon class name for the increment button.
public NumberField<T> SetIncrementButton(string incrementButtonClassName = "p-button-success", string incrementButtonIcon = "pi pi-plus")
Parameters
incrementButtonClassName
stringThe CSS class name for the increment button. Default value is "p-button-success".
incrementButtonIcon
stringThe icon class name for the increment button. Default value is "pi pi-plus".
Returns
- NumberField<T>
The current instance of the NumberField<T> class.
SetInputPrefix(string)
Sets the input prefix of the number field component.
public NumberField<T> SetInputPrefix(string prefix)
Parameters
prefix
stringThe input prefix to be set.
Returns
- NumberField<T>
The current NumberField<T> instance.
SetInputSuffix(string)
Sets the input suffix of the number field component.
public NumberField<T> SetInputSuffix(string suffix)
Parameters
suffix
stringThe input suffix to be set.
Returns
- NumberField<T>
The current NumberField<T> instance.
SetMax(int)
Sets the maximum value of the number field component.
public NumberField<T> SetMax(int max)
Parameters
max
intThe maximum value to be set.
Returns
- NumberField<T>
The current NumberField<T> instance.
SetMaxFractionDigits(int)
Sets the maximum and minimum fraction digits of the field.
public NumberField<T> SetMaxFractionDigits(int maxFractionDigits)
Parameters
maxFractionDigits
intThe maximum number of fraction digits.
Returns
- NumberField<T>
The current NumberField<T> instance.
SetMin(int)
Sets the minimum value of the number field component.
public NumberField<T> SetMin(int min)
Parameters
min
intThe minimum value to be set.
Returns
- NumberField<T>
The current NumberField<T> instance.
SetMinFractionDigits(int)
Sets the minimum and maximum fraction digits of the field.
public NumberField<T> SetMinFractionDigits(int minFractionDigits)
Parameters
minFractionDigits
intThe minimum number of fraction digits.
Returns
- NumberField<T>
The current NumberField<T> instance.
SetShowButtons(bool, ButtonLayoutTypes)
Sets whether to display increment and decrement buttons and the layout of the buttons.
public NumberField<T> SetShowButtons(bool showButtons = true, ButtonLayoutTypes buttonLayout = ButtonLayoutTypes.Stacked)
Parameters
showButtons
boolWhether to display increment and decrement buttons.
buttonLayout
ButtonLayoutTypesThe layout of the buttons. Default value is Stacked.
Returns
- NumberField<T>
The current instance of the NumberField<T> class.
SetStep(float)
Sets the step value used for incrementing or decrementing the value of the field.
public NumberField<T> SetStep(float step)
Parameters
step
floatThe step value to set.
Returns
- NumberField<T>
The current instance of the NumberField<T> class.