public class RangeSelector extends AbstractConfigurationObject
Constructor and Description |
---|
RangeSelector() |
RangeSelector(Boolean enabled) |
Modifier and Type | Method and Description |
---|---|
void |
addButton(RangeSelectorButton button)
Adds button to the buttons array
|
Boolean |
getAllButtonsEnabled() |
ButtonPosition |
getButtonPosition() |
RangeSelectorButton[] |
getButtons() |
Number |
getButtonSpacing() |
Boolean |
getEnabled() |
Number |
getHeight() |
Number |
getInputBoxHeight() |
Number |
getInputBoxWidth() |
String |
getInputDateFormat() |
String |
getInputDateParser() |
String |
getInputEditDateFormat() |
Boolean |
getInputEnabled() |
ButtonPosition |
getInputPosition() |
Number |
getSelected() |
void |
removeButton(RangeSelectorButton button)
Removes first occurrence of button in buttons array
|
void |
setAllButtonsEnabled(Boolean allButtonsEnabled)
Whether to enable all buttons from the start.
|
void |
setButtonPosition(ButtonPosition buttonPosition)
A fixed pixel position for the buttons.
|
void |
setButtons(RangeSelectorButton... buttons)
An array of configuration objects for the buttons.
|
void |
setButtonSpacing(Number buttonSpacing)
The space in pixels between the buttons in the range selector.
|
void |
setEnabled(Boolean enabled)
Enable or disable the range selector.
|
void |
setHeight(Number height)
The height of the range selector, used to reserve space for buttons and
input.
|
void |
setInputBoxHeight(Number inputBoxHeight)
The pixel height of the date input boxes.
|
void |
setInputBoxWidth(Number inputBoxWidth)
The pixel width of the date input boxes.
|
void |
setInputDateFormat(String inputDateFormat)
The date format in the input boxes when not selected for editing.
|
void |
setInputDateParser(String _fn_inputDateParser) |
void |
setInputEditDateFormat(String inputEditDateFormat)
The date format in the input boxes when they are selected for editing.
|
void |
setInputEnabled(Boolean inputEnabled)
Enable or disable the date input boxes.
|
void |
setInputPosition(ButtonPosition inputPosition)
Positioning for the input boxes.
|
void |
setSelected(Number selected)
The index of the button to appear pre-selected.
|
public RangeSelector()
public RangeSelector(Boolean enabled)
public Boolean getAllButtonsEnabled()
setAllButtonsEnabled(Boolean)
public void setAllButtonsEnabled(Boolean allButtonsEnabled)
Defaults to: false
public ButtonPosition getButtonPosition()
setButtonPosition(ButtonPosition)
public void setButtonPosition(ButtonPosition buttonPosition)
x
and y.
-
getButtonSpacing
public Number getButtonSpacing()
- See Also:
setButtonSpacing(Number)
-
setButtonSpacing
public void setButtonSpacing(Number buttonSpacing)
The space in pixels between the buttons in the range selector.
Defaults to: 0
-
getButtons
public RangeSelectorButton[] getButtons()
- See Also:
setButtons(RangeSelectorButton...)
-
setButtons
public void setButtons(RangeSelectorButton... buttons)
An array of configuration objects for the buttons.
Defaults to
buttons: [{
type: 'month',
count: 1,
text: '1m'
}, {
type: 'month',
count: 3,
text: '3m'
}, {
type: 'month',
count: 6,
text: '6m'
}, {
type: 'ytd',
text: 'YTD'
}, {
type: 'year',
count: 1,
text: '1y'
}, {
type: 'all',
text: 'All'
}]
-
addButton
public void addButton(RangeSelectorButton button)
Adds button to the buttons array
- Parameters:
button
- to add
- See Also:
setButtons(RangeSelectorButton...)
-
removeButton
public void removeButton(RangeSelectorButton button)
Removes first occurrence of button in buttons array
- Parameters:
button
- to remove
- See Also:
setButtons(RangeSelectorButton...)
-
getEnabled
public Boolean getEnabled()
- See Also:
setEnabled(Boolean)
-
setEnabled
public void setEnabled(Boolean enabled)
Enable or disable the range selector.
Defaults to: true
-
getHeight
public Number getHeight()
- See Also:
setHeight(Number)
-
setHeight
public void setHeight(Number height)
The height of the range selector, used to reserve space for buttons and
input.
Defaults to: 35
-
getInputBoxHeight
public Number getInputBoxHeight()
- See Also:
setInputBoxHeight(Number)
-
setInputBoxHeight
public void setInputBoxHeight(Number inputBoxHeight)
The pixel height of the date input boxes.
Defaults to: 17
-
getInputBoxWidth
public Number getInputBoxWidth()
- See Also:
setInputBoxWidth(Number)
-
setInputBoxWidth
public void setInputBoxWidth(Number inputBoxWidth)
The pixel width of the date input boxes.
Defaults to: 90
-
getInputDateFormat
public String getInputDateFormat()
- See Also:
setInputDateFormat(String)
-
setInputDateFormat
public void setInputDateFormat(String inputDateFormat)
The date format in the input boxes when not selected for editing.
Defaults to %b %e, %Y
.
Defaults to: %b %e %Y,
-
getInputDateParser
public String getInputDateParser()
-
setInputDateParser
public void setInputDateParser(String _fn_inputDateParser)
-
getInputEditDateFormat
public String getInputEditDateFormat()
- See Also:
setInputEditDateFormat(String)
-
setInputEditDateFormat
public void setInputEditDateFormat(String inputEditDateFormat)
The date format in the input boxes when they are selected for editing.
This must be a format that is recognized by JavaScript Date.parse.
Defaults to: %Y-%m-%d
-
getInputEnabled
public Boolean getInputEnabled()
- See Also:
setInputEnabled(Boolean)
-
setInputEnabled
public void setInputEnabled(Boolean inputEnabled)
Enable or disable the date input boxes. Defaults to enabled when there is
enough space, disabled if not (typically mobile).
-
getInputPosition
public ButtonPosition getInputPosition()
- See Also:
setInputPosition(ButtonPosition)
-
setInputPosition
public void setInputPosition(ButtonPosition inputPosition)
Positioning for the input boxes. Allowed properties are
align
, verticalAlign
, x
and
y
.
Defaults to: { align: "right" }
-
getSelected
public Number getSelected()
- See Also:
setSelected(Number)
-
setSelected
public void setSelected(Number selected)
The index of the button to appear pre-selected.
Defaults to: undefined
Copyright © 2025. All rights reserved.