Documentation ¶
Index ¶
- Constants
- func Backspace() *page.Event
- func Blur() *page.Event
- func CellClick() *page.Event
- func CellDataActionValue(key string) javascript.JavaScripter
- func Change() *page.Event
- func CheckboxColumnClick() *page.Event
- func Click() *page.Event
- func ContextMenu() *page.Event
- func DialogButton() *page.Event
- func DialogClosed() *page.Event
- func DoubleClick() *page.Event
- func DownArrow() *page.Event
- func DragDrop() *page.Event
- func EnterKey() *page.Event
- func EscapeKey() *page.Event
- func Event(event string) *page.Event
- func Focus() *page.Event
- func FocusIn() *page.Event
- func FocusOut() *page.Event
- func HeaderCellClick() *page.Event
- func Input() *page.Event
- func KeyDown() *page.Event
- func KeyPress() *page.Event
- func KeyUp() *page.Event
- func RowDataActionValue(key string) javascript.JavaScripter
- func RowSelected() *page.Event
- func Select() *page.Event
- func TabKey() *page.Event
- func TableSort() *page.Event
- func TimerExpired() *page.Event
- func UpArrow() *page.Event
- type CheckboxColumnActionValues
Constants ¶
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()` )
const ClickEvent = "click"
const DialogButtonEvent = "gr-dlgbtn"
const DialogClosedEvent = "grdlgclosed"
Variables ¶
This section is empty.
Functions ¶
func CellClick ¶
*
- 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 CheckboxColumnClick ¶
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 ContextMenu ¶
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 ¶
DialogButton returns an event that detects clicking on a dialog's button.
func DialogClosed ¶
DialogClosed indicates that a dialog has closed. This is a good time to do any required cleanup.
func DoubleClick ¶
func HeaderCellClick ¶ added in v0.12.0
HeaderCellClick responds to clicks on header cells (th)
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 TimerExpired ¶
TimerExpired is used in conjunction with a JsTimer control to detect the expiration of the timer