Overview

Packages

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

Classes

  • BasicForm
  • CalculatorWidget
  • DataRepeaterExample
  • ExampleCheckColumn1
  • ExampleCheckColumn2
  • ExampleSingleForm
  • NestedTabForm
  • PaginatorForm
  • ParamsForm
  • PersistentExampleForm
  • PersonEditPanel
  • PluginEditForm
  • PluginManagerForm
  • ProjectEditPanel
  • ProjectListForm
  • ProjectViewPanel
  • QAccordion
  • QActionControl
  • QAutocomplete
  • QBlockControl
  • QButton
  • QButtonBase
  • QCalendar
  • QCheckBox
  • QCheckBoxLegacyColumn
  • QCheckBoxList
  • QControl
  • QControlBase
  • QControlGrouping
  • QControlLabel
  • QCsvTextBox
  • QDataGrid
  • QDataGrid_CheckBoxColumn
  • QDataGrid_SortEvent
  • QDataGridBase
  • QDataGridLegacy
  • QDataGridLegacyBase
  • QDataGridLegacyColumn
  • QDataGridLegacyRow
  • QDataGridLegacyRowStyle
  • QDataRepeater
  • QDatepicker
  • QDatepickerBox
  • QDateTimePicker
  • QDateTimeTextBox
  • QDialog
  • QDialogBox
  • QDraggable
  • QDroppable
  • QDropZoneGrouping
  • QEmailTextBox
  • QFileAsset
  • QFileAssetBase
  • QFileAssetDialog
  • QFileControl
  • QFilterType
  • QFloatTextBox
  • QFontFamily
  • QForm
  • QFormBase
  • QHListItem
  • QHtmlAttributeManager
  • QHtmlAttributeManagerBase
  • QHtmlTable
  • QHtmlTableBase
  • QImageBase
  • QImageBrowser
  • QImageBrowserBase
  • QImageBrowserNav
  • QImageBrowserThumbnails
  • QImageButton
  • QImageControl
  • QImageControlBase
  • QImageFileAsset
  • QImageLabel
  • QImageLabelBase
  • QImageRollover
  • QIntegerTextBox
  • QJqButton
  • QJqCheckBox
  • QJqRadioButton
  • QJsTimer
  • QJsTimerBase
  • QLabel
  • QLinkButton
  • QListBox
  • QListBoxBase
  • QListControl
  • QListItem
  • QListItemBase
  • QListItemStyle
  • QNumericTextBox
  • QPaginatedControl
  • QPaginator
  • QPaginatorBase
  • QPanel
  • QProgressbar
  • QRadioButton
  • QRadioButtonList
  • QResizable
  • QSampleControl
  • QSelectable
  • QSlider
  • QSortable
  • QTabs
  • QTagStyler
  • QTestControl
  • QTextBox
  • QTimerExpiredEvent
  • QTreeNav
  • QTreeNavItem
  • QUrlTextBox
  • QWaitIcon
  • QWriteBox
  • RecordsSummary
  • RefreshForm
  • SampleForm
  • SelectableLabel
  • SpeedForm
  • TestImageBrowser
  • UrlForm

Traits

  • QListItemManager

Exceptions

  • QCrossScriptingException

Functions

  • __QForm_EvaluateTemplate_ObHandler
  • DataGridEvalHandleError
  • Overview
  • Package
  • Class

Class QDataGrid_CheckBoxColumn

A checkbox column that specifically is for inclusion in a QDataGrid object. The two work together to hand off important events and functionality.

The default functionality of this class shows the name of the column in the header, and uses the primary key of a database object as the checkbox id. It also stores the information on which boxes are checked in the session variable so that they can be easily recalled and do not clutter the form state. You can override additional functions below if you would like to store the checkbox state with the items themselves, or somewhere else.

If you turn on the CheckAll box in the header, you must subclass this column, and at a minimum implement the GetAllIds() function so that it knows the full set of ids to record as checked.

This column keeps track of what is checked and not checked in real time using ajax, rather than using POST methods. The primary reason is that what is visible in the table will generally not be the complete set of data available from the database if the datagrid is using a paginator.

QBaseClass
Extended by QAbstractHtmlTableColumn
Extended by QAbstractHtmlTableDataColumn
Extended by QHtmlTableCheckBoxColumn
Extended by QDataGrid_CheckBoxColumn

Direct known subclasses

ExampleCheckColumn1, ExampleCheckColumn2
Package: Controls
Located at includes/base_controls/QDataGrid_CheckBoxColumn.class.php
Methods summary
public array
# GetCheckedItemIds( )

Return the array of item ids that are checked. Default stores the ids in the session. Override if you are storing them elsewhere.

Return the array of item ids that are checked. Default stores the ids in the session. Override if you are storing them elsewhere.

Returns

array
public
# ClearCheckedItems( )

Clear all the checked items. Default stores the ids in the session. Override if you are storing them elsewhere.

Clear all the checked items. Default stores the ids in the session. Override if you are storing them elsewhere.

public
# Click( $strParameter )

A checkbox in the column was clicked. The parent datagrid routes checkbox clicks to this function. Not for general consumption.

A checkbox in the column was clicked. The parent datagrid routes checkbox clicks to this function. Not for general consumption.

We are detecting every click, rather than using ParsePostData, because in a multi-user environment, post data can be stale. Also, post data only tells us what is turned on, not what is turned off, and so we would need to query the database to see what is missing from the post data to know what should be turned off. This could be tricky, as the list of visible items might have changed.

Known issue: If you do the following things, the check all box is not checked: - Click check all, then uncheck one item, then recheck that item. To fix would require querying the entire list every time one item is checked. Not important enough to slow things down like that. - Click check all, then refresh the page. This is actually by design, because in a multi-user environment, if you refresh the page, you may get new items in the list which the previous check all click would not have checked.

Parameters

$strParameter
protected null|string
# GetCheckboxId( mixed|null $item )

Return the id attribute of the checkbox tag. Must be unique to the form. This will use the column id, which should be unique, and add the item id to the end to generate the object id.

Return the id attribute of the checkbox tag. Must be unique to the form. This will use the column id, which should be unique, and add the item id to the end to generate the object id.

Parameters

$item

Returns

null|string

Overrides

QHtmlTableCheckBoxColumn::GetCheckboxId()
protected string
# GetCheckboxValue( mixed|null $item )

Return the value attribute of the checkbox tag. Values are required in html for checkboxes.

Return the value attribute of the checkbox tag. Values are required in html for checkboxes.

Parameters

$item

Returns

string

Overrides

QHtmlTableCheckBoxColumn::GetCheckboxValue()
protected boolean
# IsChecked( mixed|null $item )

Return true to draw the checkbox corresponding to this item as checked, and false for unchecked.

Return true to draw the checkbox corresponding to this item as checked, and false for unchecked.

Parameters

$item

Returns

boolean

Overrides

QHtmlTableCheckBoxColumn::IsChecked()
public array
# GetCheckboxParams( mixed|null $item )

Returns an array of parameters to attach to the checkbox tag. Includes whether the checkbox should appear as checked. Will try the callback first, and if not present, will try overridden functions.

Returns an array of parameters to attach to the checkbox tag. Includes whether the checkbox should appear as checked. Will try the callback first, and if not present, will try overridden functions.

Parameters

$item
Null to indicate that we want the params for the header cell.

Returns

array

Overrides

QHtmlTableCheckBoxColumn::GetCheckboxParams()
protected boolean
# GetItemCheckedState( $item )

Returns the checked state of the item. Default stores the ids in the session. Override if you are storing them elsewhere.

Returns the checked state of the item. Default stores the ids in the session. Override if you are storing them elsewhere.

Parameters

$item

Returns

boolean
protected
# SetItemCheckedState( $itemId, $blnChecked )

Saves the checked state of the item to be recalled later. Default stores the ids in the session. Override if you are storing them elsewhere.

Saves the checked state of the item to be recalled later. Default stores the ids in the session. Override if you are storing them elsewhere.

Parameters

$itemId
$blnChecked
protected
# CheckAll( $blnChecked )

Checks or unchecks all the items. This will check or uncheck each individual item. Override to use a mechanism to check them all at once.

Checks or unchecks all the items. This will check or uncheck each individual item. Override to use a mechanism to check them all at once.

Parameters

$blnChecked
to check all, false to uncheck all
protected array|null
# GetAllIds( )

Override this to return an array of all the ids of the objects in the table, including ids that are not currently visible on the page being shown. If you create your own CheckAll function, or if you are not showing the CheckAll box in the header you do not need to implement this.

Override this to return an array of all the ids of the objects in the table, including ids that are not currently visible on the page being shown. If you create your own CheckAll function, or if you are not showing the CheckAll box in the header you do not need to implement this.

If you want to return an empty set, return an empty array.

Returns

array|null
protected string
# GetItemId( mixed $item )

Returns the unique id of the given item. This id will be used to generate the id in the tag of the checkbox, but will not directly correspond to the id. The given item id only needs to be unique within your list of items.

Returns the unique id of the given item. This id will be used to generate the id in the tag of the checkbox, but will not directly correspond to the id. The given item id only needs to be unique within your list of items.

The default will assume this is a database object and use the primary key as the id. Override if you want something else.

Parameters

$item

Returns

string
Methods inherited from QHtmlTableCheckBoxColumn
FetchCellObject(), FetchHeaderCellValue(), GetCheckboxName(), SetCheckParamCallback(), Sleep(), Wakeup(), __get(), __set()
Methods inherited from QAbstractHtmlTableDataColumn
FetchCellValue()
Methods inherited from QAbstractHtmlTableColumn
GetCellClass(), GetCellId(), GetCellParams(), GetCellStyle(), GetColParams(), GetHeaderCellParams(), ParsePostData(), RenderCell(), RenderColTag(), RenderHeaderCell(), __construct()
Methods inherited from QBaseClass
OverrideAttributes(), __call()
Properties summary
protected boolean $blnAllChecked

Record the state of the AllChecked checkbox in the header.

Record the state of the AllChecked checkbox in the header.

#
protected boolean $blnShowCheckAll
# false
Properties inherited from QHtmlTableCheckBoxColumn
$blnHtmlEntities, $checkParamCallback
Properties inherited from QAbstractHtmlTableDataColumn
$objOrderByClause, $objPostCallback, $objReverseOrderByClause, $strFormat, $strPostMethod
Properties inherited from QAbstractHtmlTableColumn
$blnRenderAsHeader, $blnVisible, $cellParamsCallback, $intSpan, $objCellStyler, $objColStyler, $objHeaderCellStyler, $objParentTable, $strCssClass, $strHeaderCssClass, $strId, $strName
Magic properties inherited from QHtmlTableCheckBoxColumn
$ShowCheckAll
Magic properties inherited from QAbstractHtmlTableDataColumn
$Format, $OrderByClause, $PostCallback, $PostMethod, $ReverseOrderByClause
Magic properties inherited from QAbstractHtmlTableColumn
$CellParamsCallback, $CellStyler, $ColStyler, $CssClass, $HeaderCellStyler, $HeaderCssClass, $HtmlEntities, $Id, $Name, $ParentTable, $RenderAsHeader, $Span, $Visible, $_ParentTable
API documentation generated by ApiGen