event

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CellClickDefault     = `{"row": event.goradd.match.parentElement.rowIndex, "col": event.goradd.match.cellIndex}`
	CellClickRowIndex    = `event.goradd.match.parentElement.rowIndex`
	CellClickColumnIndex = `event.goradd.match.cellIndex`
	CellClickCellId      = `event.goradd.match.id`
	CellClickRowId       = `event.goradd.match.parentElement.id`
	CellClickRowValue    = `g$(event.goradd.match).closest("tr").data("value")`
	CellClickColId       = `g$(event.goradd.match).columnId()`
)
View Source
const ClickEvent = "click"
View Source
const DialogButtonEvent = "gr-dlgbtn"
View Source
const DialogClosedEvent = "grdlgclosed"

Variables

This section is empty.

Functions

func Backspace

func Backspace() *page.Event

func Blur

func Blur() *page.Event

func CellClick

func CellClick() *page.Event

*

  • CellClick returns an event to detect clicking on a table cell.
  • Lots of things can be determined using this event by changing the return values. When this event fires,
  • the javascript environment will have the following local variables defined:
  • - this: The object on to which the event listener was attached.
  • - event: The event object for the click.
  • - event.target - the html object clicked in. If your table cell had other objects in it, this will return the
  • object clicked inside the cell. This could be important, for example, if you had form objects inside the cell,
  • and you wanted to behave differently if a form object was clicked on, verses clicking outside the form object.
  • - event.goradd.match: This will be the cell object clicked on, even if an item inside of the cell was clicked. *
  • Here are some examples of return params you can specify to return data to your action handler:
  • event.goradd.match.id - the cell id
  • event.goradd.match.tagName - the tag for the cell (either th or td)
  • event.goradd.match.cellIndex - the table index that was clicked on, starting on the left with table zero
  • g$(event.goradd.match).data('value') - the "data-value" attribute of the cell (if you specify one). Use this formula for any kind of "data-" attribute.
  • g$(event.goradd.match).parent() - the jQuery row object
  • event.goradd.match.parentElement - the html row object
  • event.goradd.match.parentElement.rowIndex - the index of the row clicked, starting with zero at the top (including any header rows).
  • event.goradd.match.parentElement.id the id of the row clicked on
  • g$(event.goradd.match).parent().data("value") - the "data-value" attribute of the row.
  • g$(event.goradd.match).columnId() - the id of the column clicked in *
  • You can put your items in a javascript array, and an array will be returned as the strParameter in the action.
  • Or you can put it in a javascript object, and a named array(hash) will be returned. *
  • By default, the cell click does not bubble. Add Bubbles() to the event to get the click
  • to bubble up from sub objects.

func CellDataActionValue added in v0.2.0

func CellDataActionValue(key string) javascript.JavaScripter

CellDataActionValue sets the ActionValue to javascript that will return the data value of the row clicked on. If you are going to use this, call it immediately after you call CellClick, and before any other calls on the event. For example:

e := event.CellClick().ActionValue(event.CellDataActionValue("cellVal")).Delay(100)

func Change

func Change() *page.Event

func CheckboxColumnClick

func CheckboxColumnClick() *page.Event

CheckboxColumnClick retuns an event that will detect a click on a checkbox table in a table, and set up the return parameters to return:

row: the index of the clicked row
col: the index of the clicked table
checked: the checked state of the checkbox after the click is processed
id: the id of the cell clicked

func Click

func Click() *page.Event

func ContextMenu

func ContextMenu() *page.Event

ContextMenu returns an event that responds to a context menu click, which is typically done by right clicking on a two mouse button, option-clicking or two-finger clicking on a Mac, or tap and hold on a touch device.

func DialogButton

func DialogButton() *page.Event

DialogButton returns an event that detects clicking on a dialog's button.

func DialogClosed

func DialogClosed() *page.Event

DialogClosed indicates that a dialog has closed. This is a good time to do any required cleanup.

func DoubleClick

func DoubleClick() *page.Event

func DownArrow

func DownArrow() *page.Event

func DragDrop

func DragDrop() *page.Event

DragDrop returns an event that responds to the javascript drop event

func EnterKey

func EnterKey() *page.Event

func EscapeKey

func EscapeKey() *page.Event

func Event

func Event(event string) *page.Event

Custom returns an event that responds to the given javascript event

func Focus

func Focus() *page.Event

func FocusIn

func FocusIn() *page.Event

func FocusOut

func FocusOut() *page.Event

func HeaderCellClick added in v0.12.0

func HeaderCellClick() *page.Event

HeaderCellClick responds to clicks on header cells (th)

func Input

func Input() *page.Event

func KeyDown

func KeyDown() *page.Event

func KeyPress

func KeyPress() *page.Event

func KeyUp

func KeyUp() *page.Event

func RowDataActionValue added in v0.2.0

func RowDataActionValue(key string) javascript.JavaScripter

RowDataActionValue returns code to use in the ActionValue to to return the data value of the row clicked on. The code can be used directly, or in a map or array. For example:

e := event.CellClick().ActionValue(event.RowDataActionValue("rowVal")).Delay(100)

func RowSelected

func RowSelected() *page.Event

RowSelected

func Select

func Select() *page.Event

func TabKey

func TabKey() *page.Event

func TableSort

func TableSort() *page.Event

TableSort is a custom event for responding to a table sort event

func TimerExpired

func TimerExpired() *page.Event

TimerExpired is used in conjunction with a JsTimer control to detect the expiration of the timer

func UpArrow

func UpArrow() *page.Event

Types

type CheckboxColumnActionValues

type CheckboxColumnActionValues struct {
	Row     int    `json:"row"`
	Column  int    `json:"col"`
	Checked bool   `json:"checked"`
	Id      string `json:"id"`
}

CheckboxColumnActionValues can be used to get the values out of the Event.

Jump to

Keyboard shortcuts

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