ajax

package
v0.0.0-...-fab95c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ajax

type Ajax struct {
	URL    string
	Method string
	Data   []byte
	Done   AjaxDone
	Fail   AjaxFail
}

Ajax represents a JQuery Ajax method.

func (Ajax) Send

func (ajax Ajax) Send()

type AjaxDone

type AjaxDone func(data js.Value)

type AjaxFail

type AjaxFail func(jqXHR js.Value)

type QueryFilter

type QueryFilter struct {
	ShowBio                            bool   `json:"show_bio,omitempty"`
	ShowChem                           bool   `json:"show_chem,omitempty"`
	ShowConsu                          bool   `json:"show_consu,omitempty"`
	Product                            string `json:"product,omitempty"`
	ProductFilterLabel                 string
	ProductBookmark                    bool   `json:"bookmark,omitempty"`
	ProducerRef                        string `json:"producer_ref,omitempty"`
	ProducerRefFilterLabel             string
	Storage                            string `json:"storage,omitempty"`
	StorageFilterLabel                 string
	Storages                           []int `json:"ids,omitempty"`
	StoragesFilterLabel                string
	UnitType                           string `json:"unit_type,omitempty"`
	Supplier                           string `json:"supplier,omitempty"`
	Producer                           string `json:"producer,omitempty"`
	StoreLocation                      string `json:"store_location,omitempty"`
	StoreLocationCanStore              bool   `json:"store_location_can_store,omitempty"`
	StoreLocationFilterLabel           string
	Entity                             string `json:"entity,omitempty"`
	EntityFilterLabel                  string
	Name                               string `json:"name,omitempty"`
	NameFilterLabel                    string
	CasNumber                          string `json:"cas_number,omitempty"`
	CasNumberFilterLabel               string
	EmpiricalFormula                   string `json:"empirical_formula,omitempty"`
	EmpiricalFormulaFilterLabel        string
	SignalWord                         string `json:"signal_word,omitempty"`
	SignalWordFilterLabel              string
	HazardStatements                   []string `json:"hazard_statements,omitempty"`
	HazardStatementsFilterLabel        string
	PrecautionaryStatements            []string `json:"precautionary_statements,omitempty"`
	PrecautionaryStatementsFilterLabel string
	Symbols                            []string `json:"symbols,omitempty"`
	SymbolsFilterLabel                 string
	Tags                               []string `json:"tags,omitempty"`
	TagsFilterLabel                    string
	Category                           string `json:"category,omitempty"`
	CategoryFilterLabel                string
	StorageBarecode                    string `json:"storage_barecode,omitempty"`
	StorageBarecodeFilterLabel         string
	CustomNamePartOf                   string `json:"custom_name_part_of,omitempty"`
	CustomNamePartOfFilterLabel        string
	CasNumberCMR                       bool `json:"cas_number_cmr,omitempty"`
	CasNumberCMRFilterLabel            string
	Borrowing                          bool `json:"borrowing,omitempty"`
	BorrowingFilterLabel               string
	StorageToDestroy                   bool `json:"storage_to_destroy,omitempty"`
	StorageToDestroyFilterLabel        string
	StorageArchive                     bool   `json:"storage_archive,omitempty"`
	StorageHistory                     bool   `json:"storage_history,omitempty"`
	StorageBatchNumber                 string `json:"storage_batch_number,omitempty"`
	StorageBatchNumberFilterLabel      string
	Export                             bool `json:"export,omitempty"`

	Search string `json:"search,omitempty"`
	Page   int    `json:"page,omitempty"`
	Sort   string `json:"sort,omitempty"`
	Order  string `json:"order,omitempty"`
	Offset int    `json:"offset,omitempty"`
	Limit  int    `json:"limit,omitempty"`
}

QueryFilter contains the parameters sent while doing AJAX requests to retrieve multiple results ("/entities", "/people"...). It is especially used by select2 and bootstraptable.

func QueryFilterFromJsJSONValue

func QueryFilterFromJsJSONValue(jsvalue js.Value) QueryFilter

QueryFilterFromJsJSONValue converts a JS JSON into a Go queryFilter.

func (QueryFilter) ToJsValue

func (q QueryFilter) ToJsValue() js.Value

ToJsValue converts a Go QueryFilter into a JS JSON.

func (QueryFilter) ToRawQuery

func (q QueryFilter) ToRawQuery() string

ToRawQuery converts a QueryFilter into an url.RawQuery

type QueryParams

type QueryParams struct {
	Data QueryFilter `js:"data"`
}

QueryParams is the data sent while requesting remote data as defined https://api.jquery.com/jquery.ajax/ and https://bootstrap-table.com/docs/api/table-options/#queryparams

type Response

type Response struct {
	Rows  js.Value `json:"rows"`
	Total js.Value `json:"total"`
}

Response contains the data retrieved from the query above.

type SafeQueryFilter

type SafeQueryFilter struct {
	QueryFilter
	// contains filtered or unexported fields
}

SafeQueryFilter is a concurent query filter used in Ajax requests.

func (*SafeQueryFilter) Clean

func (s *SafeQueryFilter) Clean()

func (*SafeQueryFilter) CleanExceptProduct

func (s *SafeQueryFilter) CleanExceptProduct()

func (*SafeQueryFilter) Lock

func (s *SafeQueryFilter) Lock()

func (*SafeQueryFilter) Unlock

func (s *SafeQueryFilter) Unlock()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL