Documentation ¶
Index ¶
- Constants
- func DropdownSelectEvent() *event.Event
- func NavbarSelectEvent() *event.Event
- type BackgroundColorClass
- type Button
- func (b *Button) Deserialize(d page.Decoder)
- func (b *Button) DrawingAttributes(ctx context.Context) html5tag.Attributes
- func (b *Button) Init(parent page.ControlI, id string)
- func (b *Button) Serialize(e page.Encoder)
- func (b *Button) SetButtonSize(size ButtonSize) ButtonI
- func (b *Button) SetButtonStyle(style ButtonStyle) ButtonI
- func (b *Button) SetIsPrimary(isPrimary bool) grctl.ButtonI
- type ButtonCreator
- type ButtonI
- type ButtonSize
- type ButtonStyle
- type Checkbox
- func (c *Checkbox) Deserialize(d page.Decoder)
- func (c *Checkbox) DrawTag(ctx context.Context, w io.Writer)
- func (c *Checkbox) DrawingAttributes(ctx context.Context) html5tag.Attributes
- func (c *Checkbox) GetDrawingLabelAttributes() html5tag.Attributes
- func (c *Checkbox) Serialize(e page.Encoder)
- func (c *Checkbox) SetInline(v bool) *Checkbox
- type CheckboxCreator
- type CheckboxList
- func (l *CheckboxList) Deserialize(d page.Decoder)
- func (l *CheckboxList) DrawingAttributes(ctx context.Context) html5tag.Attributes
- func (l *CheckboxList) Init(parent page.ControlI, id string)
- func (l *CheckboxList) RenderItem(item *control.ListItem) (h string)
- func (l *CheckboxList) Serialize(e page.Encoder)
- func (l *CheckboxList) SetCellClass(c string)
- func (l *CheckboxList) SetIsInline(i bool)
- type CheckboxListCreator
- type CheckboxListI
- type ContainerClass
- type DataPager
- func (d *DataPager) Deserialize(dec page.Decoder)
- func (d *DataPager) DrawingAttributes(ctx context.Context) html5tag.Attributes
- func (d *DataPager) Init(parent page.ControlI, id string, pagedControl control.PagedControlI)
- func (d *DataPager) NextButtonsHtml() string
- func (d *DataPager) PageButtonsHtml(i int) string
- func (d *DataPager) PreviousButtonsHtml() string
- func (d *DataPager) Serialize(e page.Encoder)
- type DataPagerCreator
- type DataPagerI
- type DateTextbox
- type DateTextboxCreator
- type DateTextboxI
- type Dropdown
- func (l *Dropdown) ButtonAttributes() html5tag.Attributes
- func (l *Dropdown) Deserialize(d page.Decoder)
- func (l *Dropdown) DrawInnerHtml(_ context.Context, w io.Writer)
- func (l *Dropdown) DrawingAttributes(ctx context.Context) html5tag.Attributes
- func (l *Dropdown) GetItemsHtml(items []*control.ListItem) string
- func (l *Dropdown) Init(parent page.ControlI, id string)
- func (l *Dropdown) MenuAttributes() html5tag.Attributes
- func (l *Dropdown) OnClick(a action.ActionI) DropdownI
- func (l *Dropdown) Serialize(e page.Encoder)
- func (l *Dropdown) SetAsNavItem(asNavItem bool) DropdownI
- type DropdownCreator
- type DropdownI
- type EmailTextbox
- type EmailTextboxCreator
- type EmailTextboxI
- type FloatTextbox
- type FloatTextboxCreator
- type FloatTextboxI
- type FormFieldset
- func (c *FormFieldset) Deserialize(d page.Decoder)
- func (c *FormFieldset) DrawInnerHtml(ctx context.Context, w io.Writer)
- func (c *FormFieldset) DrawingAttributes(ctx context.Context) html5tag.Attributes
- func (c *FormFieldset) Init(parent page.ControlI, id string)
- func (c *FormFieldset) InstructionAttributes() html5tag.Attributes
- func (c *FormFieldset) LegendAttributes() html5tag.Attributes
- func (c *FormFieldset) Serialize(e page.Encoder)
- func (c *FormFieldset) SetAsRow(r bool) FormFieldsetI
- func (c *FormFieldset) SetInstructions(instructions string) FormFieldsetI
- type FormFieldsetCreator
- type FormFieldsetI
- type FormGroup
- func (c *FormGroup) ChildValidationChanged()
- func (c *FormGroup) Deserialize(dec page.Decoder)
- func (c *FormGroup) DrawTag(ctx context.Context, w io.Writer)
- func (c *FormGroup) DrawingAttributes(ctx context.Context) html5tag.Attributes
- func (c *FormGroup) Init(parent page.ControlI, id string)
- func (c *FormGroup) InnerDivAttributes() html5tag.Attributes
- func (c *FormGroup) Serialize(e page.Encoder)
- func (c *FormGroup) SetUseTooltips(use bool) FormGroupI
- func (c *FormGroup) UseTooltips() bool
- func (c *FormGroup) Validate(ctx context.Context) bool
- type FormGroupCreator
- type FormGroupI
- type InputGroup
- type InputGroupCreator
- type InputGroupI
- type IntegerTextbox
- type IntegerTextboxCreator
- type IntegerTextboxI
- type ItemDirection
- type ListGroup
- type ListGroupCreator
- type ListGroupI
- type Modal
- func (m *Modal) AddButton(label string, id string, options *control.DialogButtonOptions)
- func (m *Modal) AddCloseButton(label string, id string)
- func (m *Modal) AddTitlebarClass(class string)
- func (m *Modal) Deserialize(d page.Decoder)
- func (d *Modal) DrawTemplate(ctx context.Context, _w io.Writer) (err error)
- func (m *Modal) DrawingAttributes(ctx context.Context) html5tag.Attributes
- func (m *Modal) Hide()
- func (m *Modal) Init(parent page.ControlI, id string)
- func (m *Modal) PrivateAction(_ context.Context, a action.Params)
- func (m *Modal) PutCustomScript(_ context.Context, response *page.Response)
- func (m *Modal) RemoveAllButtons()
- func (m *Modal) RemoveButton(id string)
- func (m *Modal) Serialize(e page.Encoder)
- func (m *Modal) SetBackdrop(b ModalBackdropType)
- func (m *Modal) SetButtonStyle(id string, a html5tag.Style)
- func (m *Modal) SetButtonText(id string, text string)
- func (m *Modal) SetButtonVisible(id string, visible bool)
- func (m *Modal) SetDialogStyle(style control.DialogStyle)
- func (m *Modal) SetHasCloseBox(h bool)
- func (m *Modal) SetTitle(t string)
- func (m *Modal) Show()
- func (m *Modal) Title() string
- type ModalBackdropType
- type ModalButtonCreator
- type ModalCreator
- type ModalI
- type NavLink
- type NavLinkCreator
- type NavLinkI
- type Navbar
- func (b *Navbar) Deserialize(d page.Decoder)
- func (b *Navbar) DrawTemplate(ctx context.Context, _w io.Writer) (err error)
- func (b *Navbar) DrawingAttributes(ctx context.Context) html5tag.Attributes
- func (b *Navbar) Init(parent page.ControlI, id string)
- func (b *Navbar) OnClick(a action.ActionI) NavbarI
- func (b *Navbar) Serialize(e page.Encoder)
- func (b *Navbar) SetBackgroundClass(c BackgroundColorClass) NavbarI
- func (b *Navbar) SetBrand(label string, anchor string, p NavbarCollapsedBrandPlacement) NavbarI
- func (b *Navbar) SetContainerClass(class ContainerClass) NavbarI
- func (b *Navbar) SetExpand(e NavbarExpandClass) NavbarI
- func (b *Navbar) SetNavbarStyle(style NavbarStyle) NavbarI
- type NavbarCollapsedBrandPlacement
- type NavbarCreator
- type NavbarExpandClass
- type NavbarI
- type NavbarStyle
- type PhoneTextbox
- type PhoneTextboxCreator
- type PhoneTextboxI
- type RadioButton
- func (c *RadioButton) Deserialize(d page.Decoder)
- func (c *RadioButton) DrawTag(ctx context.Context, w io.Writer)
- func (c *RadioButton) DrawingAttributes(ctx context.Context) html5tag.Attributes
- func (c *RadioButton) GetDrawingLabelAttributes() html5tag.Attributes
- func (c *RadioButton) Serialize(e page.Encoder)
- func (c *RadioButton) SetInline(v bool) *RadioButton
- type RadioButtonCreator
- type RadioButtonI
- type RadioList
- func (l *RadioList) Deserialize(d page.Decoder)
- func (l *RadioList) DrawingAttributes(ctx context.Context) html5tag.Attributes
- func (l *RadioList) Init(parent page.ControlI, id string)
- func (l *RadioList) RenderItem(item *control.ListItem) (h string)
- func (l *RadioList) Serialize(e page.Encoder)
- func (l *RadioList) SetCellClass(c string)
- func (l *RadioList) SetIsInline(i bool)
- type RadioListCreator
- type RadioListGroup
- func (l *RadioListGroup) Deserialize(d page.Decoder)
- func (l *RadioListGroup) DrawingAttributes(ctx context.Context) html5tag.Attributes
- func (l *RadioListGroup) Init(parent page.ControlI, id string)
- func (l *RadioListGroup) RenderItem(item *control.ListItem) (h string)
- func (l *RadioListGroup) Serialize(e page.Encoder)
- func (l *RadioListGroup) SetButtonStyle(buttonStyle string) RadioListGroupI
- type RadioListGroupCreator
- type RadioListGroupI
- type RadioListI
- type SelectList
- type SelectListCreator
- type SelectListI
- type Tabs
- type TabsCreator
- type TabsI
- type TextColorClass
- type Textbox
- type TextboxCreator
- type TextboxI
- type TitleBar
Constants ¶
const ( ButtonStylePrimary ButtonStyle = "btn-primary" ButtonStyleSecondary = "btn-secondary" ButtonStyleSuccess = "btn-success" ButtonStyleInfo = "btn-info" ButtonStyleWarning = "btn-warning" ButtonStyleDanger = "btn-danger" ButtonStyleLight = "btn-light" ButtonStyleDark = "btn-dark" ButtonStyleLink = "btn-link" ButtonStyleOutlinePrimary = "btn-outline-primary" ButtonStyleOutlineSecondary = "btn-outline-secondary" ButtonStyleOutlineSuccess = "btn-outline-success" ButtonStyleOutlineInfo = "btn-outline-info" ButtonStyleOutlineWarning = "btn-outline-warning" ButtonStyleOutlineDanger = "btn-outline-danger" ButtonStyleOutlineLight = "btn-outline-light" ButtonStyleOutlineDark = "btn-outline-dark" )
const ( ButtonSizeLarge ButtonSize = "btn-lg" ButtonSizeMedium = "" ButtonSizeSmall = "btn-sm" )
const ( Container ContainerClass = "container" ContainerFluid = "container-fluid" ContainerSmall = "container-sm" ContainerMedium = "container-md" ContainerLarge = "container-lg" ContainerXL = "container-xl" ContainerXXL = "container-xxl" )
const ( TextColorPrimary TextColorClass = "text-primary" TextColorSecondary = "text-secondary" TextColorDanger = "text-danger" TextColorWarning = "text-warning" TextColorInfo = "text-info" TextColorLight = "text-light" TextColorDark = "text-dark" TextColorBody = "text-body" TextColorMuted = "text-muted" TextColorWhite = "text-white" TextColorWhite50 = "text-white-50" TextColorBlack50 = "text-black-50" )
const ( BackgroundColorPrimary BackgroundColorClass = "bg-primary" BackgroundColorSecondary = "bg-secondary" BackgroundColorSuccess = "bg-danger" BackgroundColorDanger = "bg-danger" BackgroundColorWarning = "bg-warning" BackgroundColorInfo = "bg-info" BackgroundColorLight = "bg-light" BackgroundColorDark = "bg-dark" BackgroundColorWhite = "bg-white" BackgroundColorTransparent = "bg-transparent" BackgroundColorNone = "" // utility to allow custom background colors for components )
const ()
const (NavbarExpandNone = "" )
const ButtonBlock = "btn-block"
ButtonBlock is a class you can add to a button to make it span a full block
const ButtonClass = "btn"
const (
DialogClosed = iota + 10000
)
event codes
const DropdownSelect = "gr-bs-dropdownselect"
Variables ¶
This section is empty.
Functions ¶
func DropdownSelectEvent ¶ added in v0.21.0
func NavbarSelectEvent ¶
Types ¶
type BackgroundColorClass ¶
type BackgroundColorClass string
type Button ¶
func GetButton ¶ added in v0.2.4
GetButton is a convenience method to return the button with the given id from the page.
func (*Button) Deserialize ¶
Deserialize reconstructs the control from the page state.
func (*Button) DrawingAttributes ¶
func (b *Button) DrawingAttributes(ctx context.Context) html5tag.Attributes
DrawingAttributes returns the attributes to add to the tag just before the button is drawn.
func (*Button) SetButtonSize ¶
func (b *Button) SetButtonSize(size ButtonSize) ButtonI
SetButtonSize sets the size class of the button.
func (*Button) SetButtonStyle ¶
func (b *Button) SetButtonStyle(style ButtonStyle) ButtonI
SetButtonStyle will set the button's style to one of the predefined bootstrap styles.
type ButtonCreator ¶ added in v0.2.0
type ButtonCreator struct { // ID is the control id ID string // Text is the text displayed in the button Text string // OnSubmit is the action to take when the button is submitted. Use this specifically // for buttons that move to other pages or processes transactions, as it debounces the button // and waits until all other actions complete OnSubmit action.ActionI // OnClick is an action to take when the button is pressed. Do not specify both // a OnSubmit and OnClick. OnClick action.ActionI Style ButtonStyle Size ButtonSize IsPrimary bool ValidationType event.ValidationType page.ControlOptions }
ButtonCreator is the initialization structure for the declarative creation of the control.
type ButtonI ¶
type ButtonI interface { grctl.ButtonI SetButtonStyle(style ButtonStyle) ButtonI SetButtonSize(size ButtonSize) ButtonI }
type ButtonSize ¶
type ButtonSize string
type ButtonStyle ¶
type ButtonStyle string
type Checkbox ¶
func GetCheckbox ¶ added in v0.2.0
GetCheckbox is a convenience method to return the checkbox with the given id from the page.
func (*Checkbox) Deserialize ¶
func (*Checkbox) DrawingAttributes ¶
func (c *Checkbox) DrawingAttributes(ctx context.Context) html5tag.Attributes
func (*Checkbox) GetDrawingLabelAttributes ¶ added in v0.4.0
func (c *Checkbox) GetDrawingLabelAttributes() html5tag.Attributes
type CheckboxCreator ¶ added in v0.2.0
type CheckboxCreator struct { // ID is the id of the control ID string // Text is the text of the label displayed right next to the checkbox. Text string // Checked will initialize the checkbox in its checked state. Checked bool // LabelMode specifies how the label is drawn with the checkbox. LabelMode html5tag.LabelDrawingMode // LabelAttributes are additional attributes placed on the label tag. LabelAttributes html5tag.Attributes // SaveState will save the value of the checkbox and restore it when the page is reentered. SaveState bool // Set inline when drawing this checkbox inline or wrapped by an inline FormGroup Inline bool page.ControlOptions }
type CheckboxList ¶
type CheckboxList struct { control.CheckboxList // contains filtered or unexported fields }
CheckboxList is a multi-select control that presents its choices as a list of checkboxes. Styling is provided by divs and spans that you can provide css for in your style sheets. The goradd.css file has default styling to handle the basics. It wraps the whole thing in a div that can be set to scroll as well, so that the final structure can be styled like a multi-table table, or a single-table scrolling list much like a standard html select list.
func GetCheckboxList ¶ added in v0.2.0
func GetCheckboxList(c page.ControlI, id string) *CheckboxList
GetCheckboxList is a convenience method to return the control with the given id from the page.
func NewCheckboxList ¶
func NewCheckboxList(parent page.ControlI, id string) *CheckboxList
func (*CheckboxList) Deserialize ¶ added in v0.9.3
func (l *CheckboxList) Deserialize(d page.Decoder)
func (*CheckboxList) DrawingAttributes ¶
func (l *CheckboxList) DrawingAttributes(ctx context.Context) html5tag.Attributes
DrawingAttributes retrieves the tag's attributes at draw time. You should not normally need to call this, and the attributes are disposed of after drawing, so they are essentially read-only.
func (*CheckboxList) RenderItem ¶ added in v0.4.0
func (l *CheckboxList) RenderItem(item *control.ListItem) (h string)
RenderItem is called by the framework to render a single item in the list.
func (*CheckboxList) Serialize ¶ added in v0.9.3
func (l *CheckboxList) Serialize(e page.Encoder)
func (*CheckboxList) SetCellClass ¶ added in v0.2.0
func (l *CheckboxList) SetCellClass(c string)
SetCellClass sets a string that is applied to every cell. This is useful for setting responsive breakpoints
func (*CheckboxList) SetIsInline ¶
func (l *CheckboxList) SetIsInline(i bool)
type CheckboxListCreator ¶ added in v0.2.0
type CheckboxListCreator struct { ID string // Items is a static list of labels and values that will be in the list. Or, use a DataProvider to dynamically generate the items. Items []control.ListValue // DataProvider is the control that will dynamically provide the data for the list and that implements the DataBinder interface. DataProvider control.DataBinder // DataProviderID is the id of a control that will dynamically provide the data for the list and that implements the DataBinder interface. DataProviderID string // ColumnCount specifies how many columns to show ColumnCount int // LayoutDirection determines how the items are arranged in the columns LayoutDirection control.LayoutDirection // LabelDrawingMode specifies how the labels on the radio buttons will be associated with the buttons LabelDrawingMode html5tag.LabelDrawingMode // IsScrolling will give the inner div a vertical scroll style. You will need to style the height of the outer control to have a fixed style as well. IsScrolling bool // RowClass is the class assigned to each row RowClass string // Value is the initial value of the textbox. Often its best to load the value in a separate Load step after creating the control. Value string // SaveState saves the selected value so that it is restored if the form is returned to. SaveState bool page.ControlOptions }
func (CheckboxListCreator) Create ¶ added in v0.2.0
Create is called by the framework to create a new control from the Creator. You do not normally need to call this.
func (CheckboxListCreator) Init ¶ added in v0.2.0
func (c CheckboxListCreator) Init(ctx context.Context, ctrl CheckboxListI)
type CheckboxListI ¶
type CheckboxListI interface { control.CheckboxListI }
type ContainerClass ¶
type ContainerClass string
type DataPager ¶
type DataPager struct { control.DataPager ButtonStyle ButtonStyle HighlightStyle ButtonStyle }
DataPager is a toolbar designed to aid scrolling through a large set of data. It is implemented using Aria design best practices. It is designed to be paired with a Table or DataRepeater to aid in navigating through the data. It is similar to a Paginator, but a paginator is for navigating through a whole series of pages and not just for data on one override.
func NewDataPager ¶
func (*DataPager) Deserialize ¶
func (*DataPager) DrawingAttributes ¶
func (d *DataPager) DrawingAttributes(ctx context.Context) html5tag.Attributes
func (*DataPager) NextButtonsHtml ¶
func (*DataPager) PageButtonsHtml ¶
func (*DataPager) PreviousButtonsHtml ¶
type DataPagerCreator ¶ added in v0.2.0
type DataPagerCreator struct { // ID is the control id ID string // MaxPageButtons is the maximum number of page buttons to display in the pager MaxPageButtons int // ObjectName is the name of the object being displayed in the table ObjectName string // ObjectPluralName is the plural name of the object being displayed ObjectPluralName string // LabelForNext is the text to use in the Next button LabelForNext string // LabelForPrevious is the text to use in the Previous button LabelForPrevious string // PagedControl is the id of the control that will be paged by the pager PagedControl string page.ControlOptions // ButtonStyle is the style that will be used to draw the standard buttons ButtonStyle ButtonStyle // HighlightStyle is the style that will be used to draw the highlighted buttons HighlightStyle ButtonStyle }
DataPagerCreator is the initialization structure for declarative creation of data pagers
func (DataPagerCreator) Create ¶ added in v0.2.0
Create is called by the framework to create a new control from the Creator. You do not normally need to call this.
func (DataPagerCreator) Init ¶ added in v0.2.0
func (c DataPagerCreator) Init(ctx context.Context, ctrl DataPagerI)
Init is called by implementations of Buttons to initialize a control with the creator. You do not normally need to call this.
type DataPagerI ¶
type DataPagerI interface { control.DataPagerI }
type DateTextbox ¶
type DateTextbox struct {
control.DateTextbox
}
func GetDateTextbox ¶ added in v0.2.0
func GetDateTextbox(c page.ControlI, id string) *DateTextbox
GetDateTextbox is a convenience method to return the control with the given id from the page.
func NewDateTextbox ¶
func NewDateTextbox(parent page.ControlI, id string) *DateTextbox
func (*DateTextbox) DrawingAttributes ¶
func (t *DateTextbox) DrawingAttributes(ctx context.Context) html5tag.Attributes
type DateTextboxCreator ¶ added in v0.2.0
type DateTextboxCreator struct { // ID is the control id of the html widget and must be unique to the page ID string // Placeholder is the placeholder attribute of the textbox and shows as help text inside the field Placeholder string // Type is the type attribute of the textbox Type string // MinLength is the minimum number of characters that the user is required to enter. If the // length is less than this number, a validation error will be shown. MinLength int // MaxLength is the maximum number of characters that the user is required to enter. If the // length is more than this number, a validation error will be shown. MaxLength int // ColumnCount is the number of characters wide the textbox will be, and becomes the width attribute in the tag. // The actual width is browser dependent. For better control, use a width style property. ColumnCount int // ReadOnly sets the readonly attribute of the textbox, which prevents it from being changed by the user. ReadOnly bool // SaveState will save the text in the textbox, to be restored if the user comes back to the page. // It is particularly helpful when the textbox is being used to filter the results of a query, so that // when the user comes back to the page, he does not have to type the filter text again. SaveState bool // Text is the initial value of the textbox. Often its best to load the value in a separate Load step after creating the control. Text string // Formats is the time.format strings to use to decode the text into a date. Formats []string page.ControlOptions }
DateTextboxCreator creates an email textbox. Pass it to AddControls of a control, or as a Child of a FormFieldWrapper.
func (DateTextboxCreator) Init ¶ added in v0.2.0
func (c DateTextboxCreator) Init(ctx context.Context, ctrl DateTextboxI)
type DateTextboxI ¶ added in v0.2.0
type DateTextboxI interface { control.DateTextboxI }
type Dropdown ¶ added in v0.21.0
type Dropdown struct { control.UnorderedList // contains filtered or unexported fields }
A Dropdown implements the Bootstrap Dropdown control. The Dropdown is a button combined with a list. The button shows the list, allowing the user to select an item from the list.
func GetDropdown ¶ added in v0.21.0
GetDropdown is a convenience method to return the control with the given id from the page.
func (*Dropdown) ButtonAttributes ¶ added in v0.21.0
func (l *Dropdown) ButtonAttributes() html5tag.Attributes
ButtonAttributes returns the attributes for the internal button of the dropdown. If you change them, be sure to call Refresh().
func (*Dropdown) Deserialize ¶ added in v0.21.0
Deserialize reconstructs the control from the page state.
func (*Dropdown) DrawInnerHtml ¶ added in v0.21.0
func (*Dropdown) DrawingAttributes ¶ added in v0.21.0
func (l *Dropdown) DrawingAttributes(ctx context.Context) html5tag.Attributes
DrawingAttributes retrieves the tag's attributes at draw time. You should not normally need to call this, and the attributes are disposed of after drawing, so they are essentially read-only.
func (*Dropdown) GetItemsHtml ¶ added in v0.21.0
func (*Dropdown) MenuAttributes ¶ added in v0.21.0
func (l *Dropdown) MenuAttributes() html5tag.Attributes
MenuAttributes returns the attributes for the internal button of the dropdown. If you change them, be sure to call Refresh().
func (*Dropdown) OnClick ¶ added in v0.21.0
OnClick sets the action to take when a link in the Dropdown is selected. It will only respond to links whose href is "#", which indicates its an empty link. The ActionValue will be the id of the link clicked.
func (*Dropdown) Serialize ¶ added in v0.21.0
Serialize serializes the state of the control for the pagestate
func (*Dropdown) SetAsNavItem ¶ added in v0.21.0
type DropdownCreator ¶ added in v0.21.0
type DropdownCreator struct { // ID is the id attribute for the html object and the id for the page control ID string // Text is the label that will appear in the dropdown button Text string // Items is a static list of labels and values that will be in the list. Or, use a DataProvider to dynamically generate the items. Items []control.ListValue // DataProvider is the control that will dynamically provide the data for the list and that implements the DataBinder interface. DataProvider control.DataBinder // DataProviderID is the id of a control that will dynamically provide the data for the list and that implements the DataBinder interface. DataProviderID string AsNavItem bool // ButtonAttributes are additional attributes that will be assigned to the button. ButtonAttributes html5tag.Attributes // MenuAttributes are additional attributes that will be assigned to the menu. MenuAttributes html5tag.Attributes // OnClick is the action to take when a link is clicked or selected. It will only respond // to anchor tags whose href is set to "#". The EventValue will be the value of the item clicked. OnClick action.ActionI // ControlOptions are additional settings for the control. // If this is part of a Navbar, you should add the "nav-item" class. page.ControlOptions }
type DropdownI ¶ added in v0.21.0
type DropdownI interface { control.UnorderedListI ButtonAttributes() html5tag.Attributes MenuAttributes() html5tag.Attributes OnClick(action action.ActionI) DropdownI }
type EmailTextbox ¶
type EmailTextbox struct {
control.EmailTextbox
}
func GetEmailTextbox ¶ added in v0.2.0
func GetEmailTextbox(c page.ControlI, id string) *EmailTextbox
GetEmailTextbox is a convenience method to return the control with the given id from the page.
func NewEmailTextbox ¶
func NewEmailTextbox(parent page.ControlI, id string) *EmailTextbox
func (*EmailTextbox) DrawingAttributes ¶
func (t *EmailTextbox) DrawingAttributes(ctx context.Context) html5tag.Attributes
type EmailTextboxCreator ¶ added in v0.2.0
type EmailTextboxCreator struct { // ID is the control id of the html widget and must be unique to the page ID string // Placeholder is the placeholder attribute of the textbox and shows as help text inside the field Placeholder string // Type is the type attribute of the textbox Type string // MinLength is the minimum number of characters that the user is required to enter. If the // length is less than this number, a validation error will be shown. MinLength int // MaxLength is the maximum number of characters that the user is required to enter. If the // length is more than this number, a validation error will be shown. MaxLength int // ColumnCount is the number of characters wide the textbox will be, and becomes the width attribute in the tag. // The actual width is browser dependent. For better control, use a width style property. ColumnCount int // ReadOnly sets the readonly attribute of the textbox, which prevents it from being changed by the user. ReadOnly bool // SaveState will save the text in the textbox, to be restored if the user comes back to the page. // It is particularly helpful when the textbox is being used to filter the results of a query, so that // when the user comes back to the page, he does not have to type the filter text again. SaveState bool // Text is the initial value of the textbox. Often its best to load the value in a separate Load step after creating the control. Text string // MaxItemCount is the maximum number of email addresses allowed to be entered, separated by commas // By default it allows only 1. MaxItemCount int page.ControlOptions }
EmailTextboxCreator creates an email textbox. Pass it to AddControls of a control, or as a Child of a FormFieldWrapper.
func (EmailTextboxCreator) Init ¶ added in v0.2.0
func (c EmailTextboxCreator) Init(ctx context.Context, ctrl EmailTextboxI)
type EmailTextboxI ¶ added in v0.2.0
type EmailTextboxI interface { control.EmailTextboxI }
type FloatTextbox ¶
type FloatTextbox struct {
control.FloatTextbox
}
func GetFloatTextbox ¶ added in v0.2.0
func GetFloatTextbox(c page.ControlI, id string) *FloatTextbox
GetFloatTextbox is a convenience method to return the control with the given id from the page.
func NewFloatTextbox ¶
func NewFloatTextbox(parent page.ControlI, id string) *FloatTextbox
func (*FloatTextbox) DrawingAttributes ¶
func (t *FloatTextbox) DrawingAttributes(ctx context.Context) html5tag.Attributes
type FloatTextboxCreator ¶ added in v0.2.0
type FloatTextboxCreator struct { // ID is the control id of the html widget and must be unique to the page ID string // Placeholder is the placeholder attribute of the textbox and shows as help text inside the field Placeholder string // Type is the type attribute of the textbox Type string // MinLength is the minimum number of characters that the user is required to enter. If the // length is less than this number, a validation error will be shown. MinLength int // MaxLength is the maximum number of characters that the user is required to enter. If the // length is more than this number, a validation error will be shown. MaxLength int // ColumnCount is the number of characters wide the textbox will be, and becomes the width attribute in the tag. // The actual width is browser dependent. For better control, use a width style property. ColumnCount int // RowCount creates a multi-line textarea with the given number of rows. By default the // textbox will expand vertically by this number of lines. Use a height style property for // better control of the height of a textbox. RowCount int // ReadOnly sets the readonly attribute of the textbox, which prevents it from being changed by the user. ReadOnly bool // SaveState will save the text in the textbox, to be restored if the user comes back to the page. // It is particularly helpful when the textbox is being used to filter the results of a query, so that // when the user comes back to the page, he does not have to type the filter text again. SaveState bool // MinValue is the minimum value the user can enter. If the user does not // enter at least this amount, or enters something that is not an integer, it will fail validation // and the FormFieldWrapper will show an error. MinValue *control.FloatLimit // MaxValue is the maximum value the user can enter. If the user enter more // than this amount, or enters something that is not an integer, it will fail validation // and the FormFieldWrapper will show an error. MaxValue *control.FloatLimit // Value is the initial value of the textbox. Often its best to load the value in a separate Load step after creating the control. Value interface{} page.ControlOptions }
FloatTextboxCreator creates a textbox that only accepts numbers. Pass it to AddControls of a control, or as a Child of a FormFieldWrapper.
func (FloatTextboxCreator) Create ¶ added in v0.2.0
Create is called by the framework to create a new control from the Creator. You do not normally need to call this.
func (FloatTextboxCreator) Init ¶ added in v0.2.0
func (c FloatTextboxCreator) Init(ctx context.Context, ctrl FloatTextboxI)
Init is called by implementations of Textboxes to initialize a control with the creator. You do not normally need to call this.
type FloatTextboxI ¶ added in v0.2.0
type FloatTextboxI interface { control.FloatTextboxI }
type FormFieldset ¶ added in v0.2.0
FormFieldset is a FormGroup kind of wrapper that is specific to using a fieldset as a wrapper. See https://getbootstrap.com/docs/4.3/components/forms/#horizontal-form. You will need to coordinate with whatever you are drawing internally to get the formatting right.
func GetFormFieldset ¶ added in v0.2.0
func GetFormFieldset(c page.ControlI, id string) *FormFieldset
GetFormFieldset is a convenience method to return the fieldset with the given id from the page.
func NewFormFieldset ¶ added in v0.2.0
func NewFormFieldset(parent page.ControlI, id string) *FormFieldset
func (*FormFieldset) Deserialize ¶ added in v0.9.3
func (c *FormFieldset) Deserialize(d page.Decoder)
func (*FormFieldset) DrawInnerHtml ¶ added in v0.4.0
func (c *FormFieldset) DrawInnerHtml(ctx context.Context, w io.Writer)
func (*FormFieldset) DrawingAttributes ¶ added in v0.4.0
func (c *FormFieldset) DrawingAttributes(ctx context.Context) html5tag.Attributes
func (*FormFieldset) Init ¶ added in v0.2.0
func (c *FormFieldset) Init(parent page.ControlI, id string)
func (*FormFieldset) InstructionAttributes ¶ added in v0.2.0
func (c *FormFieldset) InstructionAttributes() html5tag.Attributes
func (*FormFieldset) LegendAttributes ¶ added in v0.2.0
func (c *FormFieldset) LegendAttributes() html5tag.Attributes
func (*FormFieldset) Serialize ¶ added in v0.9.3
func (c *FormFieldset) Serialize(e page.Encoder)
func (*FormFieldset) SetAsRow ¶ added in v0.2.0
func (c *FormFieldset) SetAsRow(r bool) FormFieldsetI
func (*FormFieldset) SetInstructions ¶ added in v0.2.0
func (c *FormFieldset) SetInstructions(instructions string) FormFieldsetI
type FormFieldsetCreator ¶ added in v0.2.0
type FormFieldsetCreator struct { // ID is the control id on the html form. ID string // Legend is the text that will be in the html label tag associated with the Child control. Legend string // Child should be a panel, or a control that draws a group of controls, // like a RadioList or CheckboxList Child page.Creator // LegendAttributes are additional attributes to add to the label tag. LegendAttributes html5tag.Attributes // Instructions contains help text that accompanies the control Instructions string // Set AsRow to true to put the legend on the same row as the content AsRow bool // ControlOptions are additional options for the wrapper tag ControlOptions page.ControlOptions }
FormFieldsetCreator creates a bootstrap fieldset, which wraps a control group with a fieldset. The Child item should be a panel or a control that groups other controls, like a RadioList or CheckboxList
func (FormFieldsetCreator) Init ¶ added in v0.2.0
func (f FormFieldsetCreator) Init(ctx context.Context, c FormFieldsetI)
type FormFieldsetI ¶ added in v0.2.0
type FormFieldsetI interface { control.PanelI LegendAttributes() html5tag.Attributes SetAsRow(r bool) FormFieldsetI SetInstructions(instructions string) FormFieldsetI }
type FormGroup ¶
type FormGroup struct { control.FormFieldWrapper // contains filtered or unexported fields }
FormGroup is a Goradd control that wraps other controls, and provides common companion functionality like a form label, validation state display, and help text.
func GetFormGroup ¶ added in v0.2.0
GetFormGroup is a convenience method to return the form group with the given id from the page.
func (*FormGroup) ChildValidationChanged ¶ added in v0.2.5
func (c *FormGroup) ChildValidationChanged()
func (*FormGroup) Deserialize ¶ added in v0.9.3
func (*FormGroup) DrawingAttributes ¶ added in v0.4.0
func (c *FormGroup) DrawingAttributes(ctx context.Context) html5tag.Attributes
func (*FormGroup) InnerDivAttributes ¶ added in v0.2.0
func (c *FormGroup) InnerDivAttributes() html5tag.Attributes
func (*FormGroup) SetUseTooltips ¶ added in v0.2.0
func (c *FormGroup) SetUseTooltips(use bool) FormGroupI
SetUseTooltips sets whether to use tooltips to display validation messages.
func (*FormGroup) UseTooltips ¶ added in v0.2.0
type FormGroupCreator ¶ added in v0.2.0
type FormGroupCreator struct { // ID is the optional control id on the html form. If you do not specify this, it // will create on for you that is the ID of the child control + "-fg" ID string // Label is the text that will be in the html label tag associated with the Child control. Label string // Child is the creator of the child control you want to wrap Child page.Creator // Instructions contains help text that will follow the control and that further describes its purpose or use. Instructions string // For specifies the id of the control that the label is for, and that is the control that we are wrapping. // You normally do not need to specify this, as it will default to the first child control, but if for some reason // that control is wrapped, you should explicitly specify the For control id here. For string // LabelAttributes are additional attributes to add to the label tag. LabelAttributes html5tag.Attributes // ErrorAttributes are additional attributes to add to the tag that displays the error. ErrorAttributes html5tag.Attributes // InstructionAttributes are additional attributes to add to the tag that displays the instructions. InstructionAttributes html5tag.Attributes // Set IsInline to true to use a "span" instead of a "div" in the wrapping tag. IsInline bool // ControlOptions are additional options for the wrapper tag ControlOptions page.ControlOptions // InnerDivAttributes are the attributes for the additional div wrapper of the control // To achieve certain effects, Bootstrap needs this addition div. To display the div, you // must specify its attributes here. Otherwise, no inner div will be displayed. InnerDivAttributes html5tag.Attributes // UseTooltips will cause validation errors to be displayed with tooltips, a specific // feature of Bootstrap UseTooltips bool }
FormGroupCreator creates a FormGroup, which wraps a control with a div or span that also has a label, validation error text and optional instructions. Pass the creator of the control you are wrapping as the Child item.
func (FormGroupCreator) Create ¶ added in v0.2.0
Create is called by the framework to create the control. You do not normally need to call it.
func (FormGroupCreator) Init ¶ added in v0.2.0
func (f FormGroupCreator) Init(ctx context.Context, c FormGroupI)
Init is called by implementations of a FormFieldWrapper to initialize the creator. You do not normally need to call this.
type FormGroupI ¶ added in v0.2.0
type FormGroupI interface { control.FormFieldWrapperI SetUseTooltips(use bool) FormGroupI UseTooltips() bool InnerDivAttributes() html5tag.Attributes }
type InputGroup ¶ added in v0.12.1
func NewInputGroup ¶ added in v0.12.1
func NewInputGroup(parent page.ControlI, id string) *InputGroup
NewInputGroup creates a new input group
type InputGroupCreator ¶ added in v0.12.1
type InputGroupI ¶ added in v0.12.1
type IntegerTextbox ¶
type IntegerTextbox struct {
control.IntegerTextbox
}
func GetIntegerTextbox ¶ added in v0.2.0
func GetIntegerTextbox(c page.ControlI, id string) *IntegerTextbox
GetIntegerTextbox is a convenience method to return the control with the given id from the page.
func NewIntegerTextbox ¶
func NewIntegerTextbox(parent page.ControlI, id string) *IntegerTextbox
func (*IntegerTextbox) DrawingAttributes ¶
func (t *IntegerTextbox) DrawingAttributes(ctx context.Context) html5tag.Attributes
type IntegerTextboxCreator ¶ added in v0.2.0
type IntegerTextboxCreator struct { // ID is the control id of the html widget and must be unique to the page ID string // Placeholder is the placeholder attribute of the textbox and shows as help text inside the field Placeholder string // Type is the type attribute of the textbox Type string // MinLength is the minimum number of characters that the user is required to enter. If the // length is less than this number, a validation error will be shown. MinLength int // MaxLength is the maximum number of characters that the user is required to enter. If the // length is more than this number, a validation error will be shown. MaxLength int // ColumnCount is the number of characters wide the textbox will be, and becomes the width attribute in the tag. // The actual width is browser dependent. For better control, use a width style property. ColumnCount int // RowCount creates a multi-line textarea with the given number of rows. By default the // textbox will expand vertically by this number of lines. Use a height style property for // better control of the height of a textbox. RowCount int // ReadOnly sets the readonly attribute of the textbox, which prevents it from being changed by the user. ReadOnly bool // SaveState will save the text in the textbox, to be restored if the user comes back to the page. // It is particularly helpful when the textbox is being used to filter the results of a query, so that // when the user comes back to the page, he does not have to type the filter text again. SaveState bool // MinValue is the minimum value the user can enter. If the user does not // enter at least this amount, or enters something that is not an integer, it will fail validation // and the FormFieldWrapper will show an error. MinValue *control.IntegerLimit // MaxValue is the maximum value the user can enter. If the user enter more // than this amount, or enters something that is not an integer, it will fail validation // and the FormFieldWrapper will show an error. MaxValue *control.IntegerLimit // Value is the initial value of the textbox. Often its best to load the value in a separate Load step after creating the control. Value interface{} page.ControlOptions }
IntegerTextboxCreator creates an integer textbox. Pass it to AddControls of a control, or as a Child of a FormFieldWrapper.
func (IntegerTextboxCreator) Create ¶ added in v0.2.0
Create is called by the framework to create a new control from the Creator. You do not normally need to call this.
func (IntegerTextboxCreator) Init ¶ added in v0.2.0
func (c IntegerTextboxCreator) Init(ctx context.Context, ctrl IntegerTextboxI)
Init is called by implementations of Textboxes to initialize a control with the creator. You do not normally need to call this.
type IntegerTextboxI ¶ added in v0.2.0
type IntegerTextboxI interface { control.IntegerTextboxI }
type ItemDirection ¶
type ItemDirection int
const ( HorizontalItemDirection ItemDirection = 0 VerticalItemDirection = 1 )
type ListGroup ¶
type ListGroup struct {
control.UnorderedList
}
A ListGroup implements the Bootstrap ListGroup control. Since just a static list isn't all that interesting, this is a dynamic list whose individual items are considered clickable. To conform with the html standard and accessibility rules, items should appear as anchors if they link to another page, but as buttons if they cause a different action, like popping up a dialog.
Use the data provider to AddItems to the list, assigning attributes as needed to produce the items you want. You can also use a proxy control to create the attributes.
func GetListGroup ¶ added in v0.2.0
GetListGroup is a convenience method to return the control with the given id from the page.
type ListGroupCreator ¶ added in v0.2.0
type ListGroupCreator struct { ID string // Items is a static list of labels and values that will be in the list. Or, use a DataProvider to dynamically generate the items. Items []control.ListValue // DataProvider is the control that will dynamically provide the data for the list and that implements the DataBinder interface. DataProvider control.DataBinder // DataProviderID is the id of a control that will dynamically provide the data for the list and that implements the DataBinder interface. DataProviderID string page.ControlOptions // ItemTag is the tag of the items. It defaults to "a". ItemTag string // OnClick is the action to take when an item is clicked. // The id of the item will appear as the action's ControlValue. OnClick action.ActionI }
func (ListGroupCreator) Create ¶ added in v0.2.0
Create is called by the framework to create a new control from the Creator. You do not normally need to call this.
func (ListGroupCreator) Init ¶ added in v0.2.0
func (c ListGroupCreator) Init(ctx context.Context, ctrl ListGroupI)
type ListGroupI ¶ added in v0.2.0
type ListGroupI interface { control.UnorderedListI }
type Modal ¶
Modal is a bootstrap modal dialog. To use a custom template in a bootstrap modal, add a Panel child element or subclass of a panel child element. To use the grid system, add the container-fluid class to that embedded panel.
func GetModal ¶ added in v0.2.3
GetListGroup is a convenience method to return the control with the given id from the page.
func (*Modal) AddButton ¶
func (m *Modal) AddButton( label string, id string, options *control.DialogButtonOptions, )
AddButton adds a button to the modal. Buttons should be added in the order to appear. Styling options you can include in options.Options:
style - ButtonStyle value size - ButtonSize value
func (*Modal) AddCloseButton ¶
AddCloseButton adds a button to the list of buttons with the given label, but this button will trigger the DialogCloseEvent instead of the DialogButtonEvent. The button will also close the dialog (by hiding it).
func (*Modal) AddTitlebarClass ¶
func (*Modal) Deserialize ¶ added in v0.9.3
func (*Modal) DrawTemplate ¶
func (*Modal) DrawingAttributes ¶
func (m *Modal) DrawingAttributes(ctx context.Context) html5tag.Attributes
func (*Modal) PutCustomScript ¶
func (*Modal) RemoveAllButtons ¶
func (m *Modal) RemoveAllButtons()
func (*Modal) RemoveButton ¶
func (*Modal) SetBackdrop ¶
func (m *Modal) SetBackdrop(b ModalBackdropType)
func (*Modal) SetButtonStyle ¶
SetButtonStyle sets css styles on a button that is already in the dialog
func (*Modal) SetButtonText ¶ added in v0.13.4
SetButtonText sets the text of a button that is already on the dialog
func (*Modal) SetButtonVisible ¶
func (*Modal) SetDialogStyle ¶ added in v0.0.3
func (m *Modal) SetDialogStyle(style control.DialogStyle)
func (*Modal) SetHasCloseBox ¶
type ModalBackdropType ¶
type ModalBackdropType int
const ( ModalBackdrop ModalBackdropType = iota // Standard bootstrap backdrop. Clicking the backdrop closes the modal. ModalStaticBackdrop // Clicking the backdrop will not close the modal. )
type ModalButtonCreator ¶ added in v0.2.3
type ModalButtonCreator struct { Label string ID string Validates bool ConfirmationMessage string PushLeft bool IsClose bool Options map[string]interface{} }
func ModalButtons ¶ added in v0.2.3
func ModalButtons(buttons ...ModalButtonCreator) []ModalButtonCreator
type ModalCreator ¶ added in v0.2.3
type ModalCreator struct { ID string Title string TitlebarClass string HasCloseBox bool Style control.DialogStyle Backdrop ModalBackdropType Buttons []ModalButtonCreator OnButton action.ActionI page.ControlOptions Children []page.Creator }
type NavLink ¶ added in v0.21.0
type NavLink struct {
}NavLink creates an anchor tag with a nav-link class. It is used to create a link in a NavBar, and generally should be a child item of a NavGroup.
func GetNavLink ¶ added in v0.21.0
GetNavLink is a convenience method to return the button with the given id from the page.
func NewNavLink ¶ added in v0.21.0
NewNavLink creates a new NavLink.
func (*NavLink) DrawingAttributes ¶ added in v0.21.0
func (l *NavLink) DrawingAttributes(ctx context.Context) html5tag.Attributes
DrawingAttributes returns the attributes to add to the tag just before the button is drawn.
type NavLinkCreator ¶ added in v0.21.0
type NavLinkCreator struct { string Text string // Alternatively, add an On handler to the ControlOptions Location string // ActiveAttributes are additional attributes to add to the active link. By default, the ActiveAttributes // will add the "active" class and aria-current=page. }ID
NavLinkCreator is the initialization structure for the declarative creation of the control.
type NavLinkI ¶ added in v0.21.0
type NavLinkI interface { grctl.ActiveLinkI }
type Navbar ¶
type Navbar struct { // contains filtered or unexported fields }
Navbar is a bootstrap navbar object. Use SetText() to set the logo text of the navbar, and SetTextIsHtml() to true to turn off encoding if needed. Add child controls to populate it. When adding NavLink objects, they should be grouped together using the NavGroup object.
func GetNavbar ¶ added in v0.2.0
GetNavbar is a convenience method to return the control with the given id from the page.
func (*Navbar) Deserialize ¶ added in v0.9.3
func (*Navbar) DrawTemplate ¶
func (*Navbar) DrawingAttributes ¶
func (b *Navbar) DrawingAttributes(ctx context.Context) html5tag.Attributes
func (*Navbar) OnClick ¶ added in v0.21.0
OnClick sets the action to take when a link in the Navbar is selected. It will only respond to links whose href is "#", which indicates its an empty link. The ActionValue will be the id of the link clicked.
func (*Navbar) SetBackgroundClass ¶
func (b *Navbar) SetBackgroundClass(c BackgroundColorClass) NavbarI
func (*Navbar) SetBrand ¶ added in v0.7.0
func (b *Navbar) SetBrand(label string, anchor string, p NavbarCollapsedBrandPlacement) NavbarI
func (*Navbar) SetContainerClass ¶ added in v0.21.1
func (b *Navbar) SetContainerClass(class ContainerClass) NavbarI
func (*Navbar) SetExpand ¶ added in v0.2.0
func (b *Navbar) SetExpand(e NavbarExpandClass) NavbarI
func (*Navbar) SetNavbarStyle ¶
func (b *Navbar) SetNavbarStyle(style NavbarStyle) NavbarI
type NavbarCollapsedBrandPlacement ¶
type NavbarCollapsedBrandPlacement int
NavbarCollapsedBrandPlacement controls the location of the brand when the navbar is collapsed
const ( NavbarCollapsedBrandPlacement = iota NavbarCollapsedBrandRight NavbarCollapsedBrandHidden )NavbarCollapsedBrandLeft
type NavbarCreator ¶ added in v0.2.0
type NavbarCreator struct { string Style NavbarStyle BackgroundColorClass BackgroundColorClass Expand NavbarExpandClass BrandLocation NavbarCollapsedBrandPlacement ContainerClass ContainerClass // to nav-link items that have an href of "#". The EventValue will be the id of the item clicked. OnClick action.ActionI }BrandAnchor
type NavbarExpandClass ¶
type NavbarExpandClass string
type PhoneTextbox ¶ added in v0.7.1
type PhoneTextbox struct {
control.PhoneTextbox
}
func GetPhoneTextbox ¶ added in v0.7.1
func GetPhoneTextbox(c page.ControlI, id string) *PhoneTextbox
GetPhoneTextbox is a convenience method to return the control with the given id from the page.
func NewPhoneTextbox ¶ added in v0.7.1
func NewPhoneTextbox(parent page.ControlI, id string) *PhoneTextbox
func (*PhoneTextbox) DrawingAttributes ¶ added in v0.7.1
func (t *PhoneTextbox) DrawingAttributes(ctx context.Context) html5tag.Attributes
type PhoneTextboxCreator ¶ added in v0.7.1
type PhoneTextboxCreator struct { // ID is the control id of the html widget and must be unique to the page ID string // Placeholder is the placeholder attribute of the textbox and shows as help text inside the field Placeholder string // Type is the type attribute of the textbox Type string // MinLength is the minimum number of characters that the user is required to enter. If the // length is less than this number, a validation error will be shown. MinLength int // MaxLength is the maximum number of characters that the user is required to enter. If the // length is more than this number, a validation error will be shown. MaxLength int // ColumnCount is the number of characters wide the textbox will be, and becomes the width attribute in the tag. // The actual width is browser dependent. For better control, use a width style property. ColumnCount int // ReadOnly sets the readonly attribute of the textbox, which prevents it from being changed by the user. ReadOnly bool // SaveState will save the text in the textbox, to be restored if the user comes back to the page. // It is particularly helpful when the textbox is being used to filter the results of a query, so that // when the user comes back to the page, he does not have to type the filter text again. SaveState bool // Text is the initial value of the textbox. Often its best to load the value in a separate Load step after creating the control. Text string page.ControlOptions }
PhoneTextboxCreator creates an phone textbox. Pass it to AddControls of a control, or as a Child of a FormFieldWrapper.
func (PhoneTextboxCreator) Init ¶ added in v0.7.1
func (c PhoneTextboxCreator) Init(ctx context.Context, ctrl PhoneTextboxI)
type PhoneTextboxI ¶ added in v0.7.1
type PhoneTextboxI interface { control.PhoneTextboxI }
type RadioButton ¶
type RadioButton struct { control.RadioButton // contains filtered or unexported fields }
func GetRadioButton ¶ added in v0.2.0
func GetRadioButton(c page.ControlI, id string) *RadioButton
GetRadioButton is a convenience method to return the radio button with the given id from the page.
func NewRadioButton ¶
func NewRadioButton(parent page.ControlI, id string) *RadioButton
func (*RadioButton) Deserialize ¶
func (c *RadioButton) Deserialize(d page.Decoder)
func (*RadioButton) DrawingAttributes ¶
func (c *RadioButton) DrawingAttributes(ctx context.Context) html5tag.Attributes
func (*RadioButton) GetDrawingLabelAttributes ¶ added in v0.4.0
func (c *RadioButton) GetDrawingLabelAttributes() html5tag.Attributes
func (*RadioButton) Serialize ¶
func (c *RadioButton) Serialize(e page.Encoder)
func (*RadioButton) SetInline ¶ added in v0.0.4
func (c *RadioButton) SetInline(v bool) *RadioButton
type RadioButtonCreator ¶ added in v0.2.0
type RadioButtonCreator struct { // ID is the id of the control ID string // Text is the text of the label displayed right next to the checkbox. Text string // Checked will initialize the checkbox in its checked state. Checked bool // LabelMode specifies how the label is drawn with the checkbox. LabelMode html5tag.LabelDrawingMode // LabelAttributes are additional attributes placed on the label tag. LabelAttributes html5tag.Attributes // SaveState will save the value of the checkbox and restore it when the page is reentered. SaveState bool // Group is the name of the group that the button belongs to Group string // Inline draws the radio group inline. Specify this when drawing the // radio button inline or in an inline FormGroup. Inline bool page.ControlOptions }
type RadioButtonI ¶
type RadioButtonI interface { control.RadioButtonI }
type RadioList ¶
RadioList is a multi-select control that presents its choices as a list of radio buttons. Styling is provided by divs and spans that you can provide css for in your style sheets. The goradd.css file has default styling to handle the basics. It wraps the whole thing in a div that can be set to scroll as well, so that the final structure can be styled like a multi-table table, or a single-table scrolling list much like a standard html select list.
func GetRadioList ¶ added in v0.2.0
GetRadioList is a convenience method to return the control with the given id from the page.
func (*RadioList) Deserialize ¶ added in v0.9.3
func (*RadioList) DrawingAttributes ¶ added in v0.4.0
func (l *RadioList) DrawingAttributes(ctx context.Context) html5tag.Attributes
DrawingAttributes retrieves the tag's attributes at draw time. You should not normally need to call this, and the attributes are disposed of after drawing, so they are essentially read-only.
func (*RadioList) RenderItem ¶ added in v0.4.0
RenderItem is called by the framework to render a single item in the list.
func (*RadioList) SetCellClass ¶ added in v0.2.0
SetCellClass sets a string that is applied to every cell. This is useful for setting responsive breakpoints
func (*RadioList) SetIsInline ¶ added in v0.2.0
type RadioListCreator ¶ added in v0.2.0
type RadioListCreator struct { ID string // Items is a static list of labels and values that will be in the list. Or, use a DataProvider to dynamically generate the items. Items []control.ListValue // DataProvider is the control that will dynamically provide the data for the list and that implements the DataBinder interface. DataProvider control.DataBinder // DataProviderID is the id of a control that will dynamically provide the data for the list and that implements the DataBinder interface. DataProviderID string // ColumnCount specifies how many columns to show ColumnCount int // LayoutDirection determines how the items are arranged in the columns LayoutDirection control.LayoutDirection // LabelDrawingMode specifies how the labels on the radio buttons will be associated with the buttons LabelDrawingMode html5tag.LabelDrawingMode // IsScrolling will give the inner div a vertical scroll style. You will need to style the height of the outer control to have a fixed style as well. IsScrolling bool // RowClass is the class assigned to each row RowClass string // Value is the initial value of the textbox. Often its best to load the value in a separate Load step after creating the control. Value string // OnChange is the action to take when any of the radio buttons in the list change OnChange action.ActionI // SaveState saves the selected value so that it is restored if the form is returned to. SaveState bool page.ControlOptions }
func (RadioListCreator) Create ¶ added in v0.2.0
Create is called by the framework to create a new control from the Creator. You do not normally need to call this.
func (RadioListCreator) Init ¶ added in v0.2.0
func (c RadioListCreator) Init(ctx context.Context, ctrl RadioListI)
type RadioListGroup ¶ added in v0.12.0
type RadioListGroup struct { RadioList // contains filtered or unexported fields }
RadioListGroup is a RadioList styled as a group.
See https://getbootstrap.com/docs/4.4/components/buttons/#checkbox-and-radio-buttons
func GetRadioListGroup ¶ added in v0.12.0
func GetRadioListGroup(c page.ControlI, id string) *RadioListGroup
GetRadioListGroup is a convenience method to return the control with the given id from the page.
func NewRadioListGroup ¶ added in v0.12.0
func NewRadioListGroup(parent page.ControlI, id string) *RadioListGroup
func (*RadioListGroup) Deserialize ¶ added in v0.12.0
func (l *RadioListGroup) Deserialize(d page.Decoder)
func (*RadioListGroup) DrawingAttributes ¶ added in v0.12.0
func (l *RadioListGroup) DrawingAttributes(ctx context.Context) html5tag.Attributes
DrawingAttributes retrieves the tag's attributes at draw time. You should not normally need to call this, and the attributes are disposed of after drawing, so they are essentially read-only.
func (*RadioListGroup) Init ¶ added in v0.12.0
func (l *RadioListGroup) Init(parent page.ControlI, id string)
func (*RadioListGroup) RenderItem ¶ added in v0.12.0
func (l *RadioListGroup) RenderItem(item *control.ListItem) (h string)
RenderItem is called by the framework to render a single item in the list.
func (*RadioListGroup) Serialize ¶ added in v0.12.0
func (l *RadioListGroup) Serialize(e page.Encoder)
func (*RadioListGroup) SetButtonStyle ¶ added in v0.12.0
func (l *RadioListGroup) SetButtonStyle(buttonStyle string) RadioListGroupI
type RadioListGroupCreator ¶ added in v0.12.0
type RadioListGroupCreator struct { ID string // Items is a static list of labels and values that will be in the list. Or, use a DataProvider to dynamically generate the items. Items []control.ListValue // DataProvider is the control that will dynamically provide the data for the list and that implements the DataBinder interface. DataProvider control.DataBinder // DataProviderID is the id of a control that will dynamically provide the data for the list and that implements the DataBinder interface. DataProviderID string // Value is the initial value of the radio list. Often its best to load the value in a separate Load step after creating the control. Value string // SaveState saves the selected value so that it is restored if the form is returned to. ButtonStyle string // OnChange is the action to take when any of the radio buttons in the list change OnChange action.ActionI SaveState bool page.ControlOptions }
func (RadioListGroupCreator) Create ¶ added in v0.12.0
Create is called by the framework to create a new control from the Creator. You do not normally need to call this.
func (RadioListGroupCreator) Init ¶ added in v0.12.0
func (c RadioListGroupCreator) Init(ctx context.Context, ctrl RadioListGroupI)
type RadioListGroupI ¶ added in v0.12.0
type RadioListGroupI interface { RadioListI SetButtonStyle(string) RadioListGroupI }
type RadioListI ¶
type RadioListI interface { control.RadioListI }
type SelectList ¶
type SelectList struct {
control.SelectList
}
func GetSelectList ¶ added in v0.2.0
func GetSelectList(c page.ControlI, id string) *SelectList
GetSelectList is a convenience method to return the control with the given id from the page.
func NewSelectList ¶
func NewSelectList(parent page.ControlI, id string) *SelectList
func (*SelectList) DrawingAttributes ¶
func (l *SelectList) DrawingAttributes(ctx context.Context) html5tag.Attributes
type SelectListCreator ¶ added in v0.2.0
type SelectListCreator struct { ID string // Items is a static list of labels and values that will be in the list. Or, use a DataProvider to dynamically generate the items. Items []control.ListValue // NilItem is a helper to add an item at the top of the list with a nil value. This is often // used to specify no selection, or a message that a selection is required. NilItem string // DataProvider is the control that will dynamically provide the data for the list and that implements the DataBinder interface. DataProvider control.DataBinder // DataProviderID is the id of a control that will dynamically provide the data for the list and that implements the DataBinder interface. DataProviderID string // Size specifies how many items to show, and turns the list into a scrolling list Size int // Value is the initial value of the textbox. Often its best to load the value in a separate Load step after creating the control. Value string // SaveState saves the selected value so that it is restored if the form is returned to. SaveState bool page.ControlOptions }
func (SelectListCreator) Init ¶ added in v0.2.0
func (c SelectListCreator) Init(ctx context.Context, ctrl SelectListI)
type SelectListI ¶ added in v0.2.0
type SelectListI interface { control.SelectListI }
type Tabs ¶
Tabs draws its child controls as a set of tabs. The labels of the children serve as the tab labels. This currently draws everything at once, with the current panel visible, but everything else has hidden html.
func GetTabs ¶ added in v0.2.0
GetTabs is a convenience method to return the control with the given id from the page.
func (*Tabs) Deserialize ¶ added in v0.9.3
func (*Tabs) DrawTemplate ¶
func (*Tabs) DrawingAttributes ¶
func (t *Tabs) DrawingAttributes(ctx context.Context) html5tag.Attributes
type TabsCreator ¶ added in v0.2.0
type TabsCreator struct { // ID is the control id of the html widget and must be unique to the page ID string page.ControlOptions Children []page.Creator }
type TextColorClass ¶
type TextColorClass string
type Textbox ¶
func GetTextbox ¶ added in v0.2.3
GetTextbox is a convenience method to return the control with the given id from the page.
func (*Textbox) DrawingAttributes ¶
func (t *Textbox) DrawingAttributes(ctx context.Context) html5tag.Attributes
type TextboxCreator ¶ added in v0.2.0
type TextboxCreator struct { // ID is the control id of the html widget and must be unique to the page ID string // Placeholder is the placeholder attribute of the textbox and shows as help text inside the field Placeholder string // Type is the type attribute of the textbox Type string // MinLength is the minimum number of characters that the user is required to enter. If the // length is less than this number, a validation error will be shown. MinLength int // MaxLength is the maximum number of characters that the user is required to enter. If the // length is more than this number, a validation error will be shown. MaxLength int // ColumnCount is the number of characters wide the textbox will be, and becomes the width attribute in the tag. // The actual width is browser dependent. For better control, use a width style property. ColumnCount int // RowCount creates a multi-line textarea with the given number of rows. By default, the // textbox will expand vertically by this number of lines. Use a height style property for // better control of the height of a textbox. RowCount int // ReadOnly sets the readonly attribute of the textbox, which prevents it from being changed by the user. ReadOnly bool // SaveState will save the text in the textbox, to be restored if the user comes back to the page. // It is particularly helpful when the textbox is being used to filter the results of a query, so that // when the user comes back to the page, he does not have to type the filter text again. SaveState bool // Text is the initial value of the textbox. Generally you would not use this, but rather load the value in a separate Load step after creating the control. Text string page.ControlOptions }
TextboxCreator creates a textbox. Pass it to AddControls of a control, or as a Child of a FormGroup.
Source Files ¶
- build.go
- button.go
- checkbox.go
- const.go
- data_pager.go
- dropdown.go
- form_fieldset.go
- form_group.go
- input_group.go
- list_checkbox.go
- list_group.go
- list_radio.go
- list_radiogroup.go
- list_select.go
- modal.go
- modal.tpl.go
- nav_link.go
- navbar.go
- navbar.tpl.go
- radioButton.go
- tabs.go
- tabs.tpl.go
- textbox.go
- textbox_date.go
- textbox_email.go
- textbox_float.go
- textbox_integer.go
- textbox_phone.go