Documentation ¶
Index ¶
- func Select2GenericAjaxData(this js.Value, args []js.Value) interface{}
- func Select2GenericAjaxProcessResults(select2ResultAble Select2ResultAble) func(this js.Value, args []js.Value) interface{}
- func Select2GenericCreateTag(select2ItemAble Select2ItemAble) func(this js.Value, args []js.Value) interface{}
- func Select2GenericTemplateResults(select2ItemAble Select2ItemAble) func(this js.Value, args []js.Value) interface{}
- type FakeItem
- type Select2
- type Select2Ajax
- type Select2Config
- type Select2Data
- type Select2Item
- type Select2ItemAble
- type Select2Pagination
- type Select2ResultAble
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Select2GenericAjaxData ¶
Select2GenericAjaxData returns the most common request parameters for select2 as defined https://select2.org/data-sources/ajax#request-parameters
func Select2GenericAjaxProcessResults ¶
func Select2GenericAjaxProcessResults(select2ResultAble Select2ResultAble) func(this js.Value, args []js.Value) interface{}
func Select2GenericCreateTag ¶
func Select2GenericCreateTag(select2ItemAble Select2ItemAble) func(this js.Value, args []js.Value) interface{}
func Select2GenericTemplateResults ¶
func Select2GenericTemplateResults(select2ItemAble Select2ItemAble) func(this js.Value, args []js.Value) interface{}
Types ¶
type FakeItem ¶
func (FakeItem) FromJsJSONValue ¶
func (f FakeItem) FromJsJSONValue(jsvalue js.Value) Select2ItemAble
func (FakeItem) GetSelect2Id ¶
func (FakeItem) GetSelect2Text ¶
type Select2 ¶
func NewSelect2 ¶
func NewSelect2(jq jquery.Jquery, config *Select2Config) Select2
func (Select2) Select2AppendOption ¶
func (s Select2) Select2AppendOption(o interface{})
func (Select2) Select2Clear ¶
func (s Select2) Select2Clear()
func (Select2) Select2Data ¶
func (s Select2) Select2Data() []Select2Item
func (Select2) Select2IsInitialized ¶
func (Select2) Select2ify ¶
func (s Select2) Select2ify()
type Select2Ajax ¶
type Select2Ajax struct { URL string `json:"url"` DataType string `json:"datatype"` Data interface{} `json:"data"` ProcessResults interface{} `json:"processResults"` }
Select2Ajax is a select2 ajax request as defined https://select2.org/data-sources/ajax
type Select2Config ¶
type Select2Config struct { Placeholder string `json:"placeholder"` AllowClear bool `json:"allowClear"` Tags bool `json:"tags"` Ajax Select2Ajax `json:"ajax"` TemplateResult interface{} `json:"templateResult,omitempty"` TemplateSelection interface{} `json:"templateSelection,omitempty"` CreateTag interface{} `json:"createTag,omitempty"` }
Select2Config is a select2 parameters struct as defined https://select2.org/configuration
type Select2Data ¶
type Select2Data struct { // Results []Select2Item `json:"results"` Results []Select2ItemAble `json:"results"` Pagination Select2Pagination `json:"pagination"` }
Select2Data is a select2 data struct as defined https://select2.org/data-sources/formats
func (Select2Data) ToJsValue ¶
func (s Select2Data) ToJsValue() js.Value
type Select2Item ¶
func Select2ItemFromJsJSONValue ¶
func Select2ItemFromJsJSONValue(jsvalue js.Value) Select2Item
func (Select2Item) IDIsDigit ¶
func (s Select2Item) IDIsDigit() bool
func (Select2Item) IsEmpty ¶
func (s Select2Item) IsEmpty() bool
func (Select2Item) ToJsValue ¶
func (s Select2Item) ToJsValue() js.Value
func (*Select2Item) UnmarshalJSON ¶
func (s *Select2Item) UnmarshalJSON(data []byte) error
type Select2ItemAble ¶
type Select2ItemAble interface { GetSelect2Id() int GetSelect2Text() string FromJsJSONValue(js.Value) Select2ItemAble }
type Select2Pagination ¶
type Select2Pagination struct {
More bool `json:"more"`
}
type Select2ResultAble ¶
type Select2ResultAble interface { FromJsJSONValue(js.Value) Select2ResultAble GetRows() []Select2ItemAble GetRowConcreteTypeName() string GetTotal() int IsExactMatch() bool }
select2.Select2ResultAble represents a type that can fill in select2 data as defined https://select2.org/data-sources/ajax#transforming-response-data
Click to show internal directories.
Click to hide internal directories.