Overview

Packages

  • Actions
  • Codegen
  • Controls
    • Base
  • DatabaseAdapters
  • Events
  • None
  • Sessions
  • Tests

Classes

  • QBackspaceKeyEvent
  • QBlurEvent
  • QCellClickEvent
  • QChangeEvent
  • QClickEvent
  • QContextMenuEvent
  • QDoubleClickEvent
  • QDownArrowKeyEvent
  • QDragDropEvent
  • QEnterKeyEvent
  • QEscapeKeyEvent
  • QEvent
  • QFocusEvent
  • QFocusInEvent
  • QFocusOutEvent
  • QInputEvent
  • QJqUiEvent
  • QJqUiPropertyEvent
  • QKeyDownEvent
  • QKeyPressEvent
  • QKeyUpEvent
  • QMouseDownEvent
  • QMouseEnterEvent
  • QMouseLeaveEvent
  • QMouseMoveEvent
  • QMouseOutEvent
  • QMouseOverEvent
  • QMouseUpEvent
  • QOnEvent
  • QSelectEvent
  • QTabKeyEvent
  • QUpArrowKeyEvent
  • Overview
  • Package
  • Class

Class QCellClickEvent

Class QCellClickEvent An event to detect clicking on a table cell. Lots of things can be determined using this event by changing the JsReturnParam 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 column index that was clicked on, starting on the left with column zero $j(this).data('value') - the "data-value" attribute of the cell (if you specify one). Use this formula for any kind of "data-" attribute. $j(this).parent() - the jQuery row object $j(this).parent()[0] - the html row object $j(this).parent()[0].rowIndex - the index of the row clicked, starting with zero at the top (including any header rows). $j(this).parent().attr('id') or $j(this).parent()[0].id - the id of the row clicked on $j(this).parent().data("value") - the "data-value" attribute of the row. Use this formula for any kind of "data-" attribute. $j(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.

The default returns the array(row=>rowIndex, col=>colIndex), but you can override this with your action. For example:

new QAjaxAction ('yourFunction', null, 'this.cellIndex')

will return the column index into the strParameter, instead of the default.

QBaseClass
Extended by QEvent
Extended by QClickEvent
Extended by QCellClickEvent
Package: Events
Located at includes/base_controls/_events.inc.php
Methods summary
public
# __construct( integer $intDelay = 0, string $strCondition = null, string $mixReturnParams = null )

Create an event.

Create an event.

Parameters

$intDelay
ms delay to wait before action is fired
$strCondition
javascript condition to check before firing the action
$mixReturnParams
$strSelector jquery selector to cause event to be attached to child items instead of this item

Throws

Exception|QCallerException

Overrides

QEvent::__construct()
public static string
# RowDataValue( $strKey )

Returns the javascript that returns the row data value into a param

Returns the javascript that returns the row data value into a param

Parameters

$strKey

Returns

string
public static string
# CellDataValue( $strKey )

Same for the cell.

Same for the cell.

Parameters

$strKey

Returns

string
public integer|mixed|null|string
# __get( string $strName )

The PHP Magic function for this class

The PHP Magic function for this class

Parameters

$strName
Name of the property to fetch

Returns

integer|mixed|null|string

Throws

Exception|QCallerException

Overrides

QEvent::__get()
Methods inherited from QBaseClass
OverrideAttributes(), __call(), __set()
Constants summary
string RowIndex
# '$j(this).parent()[0].rowIndex'
string ColumnIndex
# 'this.cellIndex'
string CellId
# 'this.id'
string RowId
# '$j(this).parent().attr("id")'
string RowValue
# '$j(this).parent().data("value")'
string ColId
# '$j(this).parent().closest("table").find("thead").find("th")[this.cellIndex].id'
Constants inherited from QClickEvent
EventName
Properties summary
protected $strReturnParam
#
Properties inherited from QEvent
$intDelay, $strCondition, $strSelector
Magic properties inherited from QEvent
$Condition, $Delay, $EventName, $JsReturnParam, $Selector
API documentation generated by ApiGen