event

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CellClickDefault     = `{"row": this.parentElement.rowIndex, "col": this.cellIndex}`
	CellClickRowIndex    = `this.parentElement.rowIndex`
	CellClickColumnIndex = `this.cellIndex`
	CellClickCellId      = `this.id`
	CellClickRowId       = `g$(this).parent().id`
	CellClickRowValue    = `g$(g$(this).parent()).data("value")`
	CellClickColId       = `g$(g$(g$(this).closest("table")).qs("thead")).qa("th")[this.cellIndex].id`
)
View Source
const ClickEvent = "click"
View Source
const DialogButtonEvent = "grdlgbtn"
View Source
const DialogClosedEvent = "grdlgclosed"
View Source
const DialogClosingEvent = "grdlgclosing"

Variables

This section is empty.

Functions

func Backspace

func Backspace() page.EventI

func Blur

func Blur() page.EventI

func CellClick

func CellClick() page.EventI

*

  • 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 html object for the cell clicked.
  • - event: The event object for the click. *
  • Here are some examples of return params you can specify to return data to your action handler:
  • this.id - the cell id
  • this.tagName - the tag for the cell (either th or td)
  • this.cellIndex - the table index that was clicked on, starting on the left with table zero
  • g$(this).data('value') - the "data-value" attribute of the cell (if you specify one). Use this formula for any kind of "data-" attribute.
  • g$(this).parent() - the jQuery row object
  • this.parentElement - the html row object
  • this.parentElement.rowIndex - the index of the row clicked, starting with zero at the top (including any header rows).
  • this.parentElement.id the id of the row clicked on
  • g$(this).parent().data("value") - the "data-value" attribute of the row.
  • g$(this).parent().closest('table').find('thead').find('th')[this.cellIndex].id - the id of the column clicked in
  • 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. *
  • 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.

func CellDataActionValue added in v0.2.0

func CellDataActionValue(key string) javascript.ΩjsCode

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.EventI

func CheckboxColumnClick

func CheckboxColumnClick() page.EventI

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.EventI

func ContextMenu

func ContextMenu() page.EventI

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.EventI

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

func DialogClosed

func DialogClosed() page.EventI

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

func DialogClosing

func DialogClosing() page.EventI

DialogClosing indicates that a dialog is about to close. This is a good time to gather up any information that you might need.

func DoubleClick

func DoubleClick() page.EventI

func DownArrow

func DownArrow() page.EventI

func DragDrop

func DragDrop() page.EventI

DragDrop returns an event that responds to the javascript drop event

func EnterKey

func EnterKey() page.EventI

func EscapeKey

func EscapeKey() page.EventI

func Event

func Event(event string) page.EventI

Custom returns an event that responds to the given javascript event

func Focus

func Focus() page.EventI

func FocusIn

func FocusIn() page.EventI

func FocusOut

func FocusOut() page.EventI

func Input

func Input() page.EventI

func KeyDown

func KeyDown() page.EventI

func KeyPress

func KeyPress() page.EventI

func KeyUp

func KeyUp() page.EventI

func RowDataActionValue added in v0.2.0

func RowDataActionValue(key string) javascript.ΩjsCode

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.EventI

RowSelected

func Select

func Select() page.EventI

func TabKey

func TabKey() page.EventI

func TableSort

func TableSort() page.EventI

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

func TimerExpired

func TimerExpired() page.EventI

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

func UpArrow

func UpArrow() page.EventI

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