Implements interfaces:
TDataGrid class
TDataGrid represents a data bound and updatable grid control.
To populate data into the datagrid, sets its DataSource to a tabular data source and call dataBind(). Each row of data will be represented by an item in the Items collection of the datagrid.
An item can be at one of three states: browsing, selected and edit. The state determines how the item will be displayed. For example, if an item is in edit state, it may be displayed as a table row with input text boxes if the columns are of type TBoundColumn; and if in browsing state, they are displayed as static text.
To change the state of an item, set EditItemIndex or SelectedItemIndex property.
A datagrid is specified with a list of columns. Each column specifies how the corresponding table column will be displayed. For example, the header/footer text of that column, the cells in that column, and so on. The following column types are currently provided by the framework,
- <com:TDataGrid ...>
- <com:TBoundColumn .../>
- <com:TEditCommandColumn .../>
- </com:TDataGrid>
- $column=new TBoundColumn;
- $datagrid->Columns[]=$column;
TDataGrid supports sorting. If the AllowSorting is set to true, a column with nonempty setSortExpression will have its header text displayed as a clickable link button. Clicking on the link button will raise OnSortCommand event. You can respond to this event, sort the data source according to the event parameter, and then invoke databind() on the datagrid to show to end users the sorted data.
TDataGrid supports paging. If the AllowPaging is set to true, a pager will be displayed on top and/or bottom of the table. How the pager will be displayed is determined by the PagerStyle property. Clicking on a pager button will raise an OnPageIndexChanged event. You can respond to this event, specify the page to be displayed by setting CurrentPageIndex</b> property, and then invoke databind() on the datagrid to show to end users a new page of data.
TDataGrid supports two kinds of paging. The first one is based on the number of data items in datasource. The number of pages PageCount is calculated based the item number and the PageSize property. The datagrid will manage which section of the data source to be displayed based on the CurrentPageIndex property. The second approach calculates the page number based on the VirtualItemCount property and the PageSize property. The datagrid will always display from the beginning of the datasource up to the number of PageSize data items. This approach is especially useful when the datasource may contain too many data items to be managed by the datagrid efficiently.
When the datagrid contains a button control that raises an onCommand event, the event will be bubbled up to the datagrid control. If the event's command name is recognizable by the datagrid control, a corresponding item event will be raised. The following item events will be raised upon a specific command:
TDataGrid also raises an OnItemCreated event for every newly created datagrid item. You can respond to this event to customize the content or style of the newly created item.
Located in /Web/UI/WebControls/TDataGrid.php (line 136)
TComponent | --TApplicationComponent | --TControl | --TWebControl | --TDataBoundControl | --TBaseDataList | --TDataGrid
Adds objects parsed in template to datagrid.
Only datagrid columns are added into Columns collection.
Applies styles to items, header, footer and separators.
Item styles are applied in a hierarchical way. Style in higher hierarchy will inherit from styles in lower hierarchy. Starting from the lowest hierarchy, the item styles include item's own style, ItemStyle, AlternatingItemStyle, SelectedItemStyle, and EditItemStyle. Therefore, if background color is set as red in ItemStyle, EditItemStyle will also have red background color unless it is set to a different value explicitly.
This method overrides parent's implementation to handle onItemCommand event which is bubbled from TDataGridItem child controls.
If the event parameter is TDataGridCommandEventParameter and the command name is a recognized one, which includes 'select', 'edit', 'delete', 'update', and 'cancel' (case-insensitive), then a corresponding command event is also raised (such as OnEditCommand). This method should only be used by control developers.
Builds a next-prev pager
Builds a numeric pager
Builds the pager content based on pager style.
Automatically generates datagrid columns based on datasource schema
Creates a datagrid item instance based on the item type and index.
Creates a pager button.
Creates a style object for the control.
This method creates a TTableStyle to be used by datagrid.
Initializes a datagrid item and cells inside it
Loads item count information from viewstate.
This method is invoked right after control state is loaded.
Raises OnCancelCommand event.
This method is invoked when a button control raises OnCommand event with cancel command name.
Raises OnDeleteCommand event.
This method is invoked when a button control raises OnCommand event with delete command name.
Raises OnEditCommand event.
This method is invoked when a button control raises OnCommand event with edit command name.
Raises OnItemCommand event.
This method is invoked when a button control raises OnCommand event.
Raises OnItemCreated event.
This method is invoked right after a datagrid item is created and before added to page hierarchy.
Raises OnItemDataBound event.
This method is invoked for each datagrid item after it performs databinding.
Raises OnPageIndexChanged event.
This method is invoked when current page is changed.
Raises OnPagerCreated event.
This method is invoked right after a datagrid pager is created and before added to page hierarchy.
Raises OnSortCommand event.
This method is invoked when a button control raises OnCommand event with sort command name.
Raises OnUpdateCommand event.
This method is invoked when a button control raises OnCommand event with update command name.
Performs databinding to populate data list items from data source.
This method is invoked by dataBind(). You may override this function to provide your own way of data population.
Renders the datagrid.
Renders the openning tag for the datagrid control which will render table caption if present.
Clears up all items in the datagrid.
Restores datagrid content from viewstate.
Saves item count in viewstate.
This method is invoked right before control state is to be saved.
Edits an item by its index in getItems.
Previously editting item will change to normal item state. If the index is less than 0, any existing edit item will be cleared up.
Selects an item by its index in getItems.
Previously selected item will be un-selected. If the item to be selected is already in edit mode, it will remain in edit mode. If the index is less than 0, any existing selection will be cleared up.
Inherited From TBaseDataList
TBaseDataList::addParsedObject()
TBaseDataList::createStyle()
TBaseDataList::getCaption()
TBaseDataList::getCaptionAlign()
TBaseDataList::getCellPadding()
TBaseDataList::getCellSpacing()
TBaseDataList::getDataFieldValue()
TBaseDataList::getDataKeyField()
TBaseDataList::getDataKeys()
TBaseDataList::getGridLines()
TBaseDataList::getHorizontalAlign()
TBaseDataList::onSelectedIndexChanged()
TBaseDataList::setCaption()
TBaseDataList::setCaptionAlign()
TBaseDataList::setCellPadding()
TBaseDataList::setCellSpacing()
TBaseDataList::setDataKeyField()
TBaseDataList::setGridLines()
TBaseDataList::setHorizontalAlign()
Inherited From TDataBoundControl
TDataBoundControl::dataBind()
TDataBoundControl::dataSourceViewChanged()
TDataBoundControl::determineDataSource()
TDataBoundControl::ensureDataBound()
TDataBoundControl::getData()
TDataBoundControl::getDataMember()
TDataBoundControl::getDataSource()
TDataBoundControl::getDataSourceID()
TDataBoundControl::getDataSourceView()
TDataBoundControl::getInitialized()
TDataBoundControl::getIsDataBound()
TDataBoundControl::getRequiresDataBinding()
TDataBoundControl::getSelectParameters()
TDataBoundControl::getUsingDataSourceID()
TDataBoundControl::onDataBound()
TDataBoundControl::onDataSourceChanged()
TDataBoundControl::onInit()
TDataBoundControl::onPreRender()
TDataBoundControl::pagePreLoad()
TDataBoundControl::performDataBinding()
TDataBoundControl::setDataMember()
TDataBoundControl::setDataSource()
TDataBoundControl::setDataSourceID()
TDataBoundControl::setInitialized()
TDataBoundControl::setIsDataBound()
TDataBoundControl::setRequiresDataBinding()
TDataBoundControl::validateDataSource()
Inherited From TWebControl
TWebControl::addAttributesToRender()
TWebControl::copyBaseAttributes()
TWebControl::createStyle()
TWebControl::getAccessKey()
TWebControl::getBackColor()
TWebControl::getBorderColor()
TWebControl::getBorderStyle()
TWebControl::getBorderWidth()
TWebControl::getCssClass()
TWebControl::getFont()
TWebControl::getForeColor()
TWebControl::getHasStyle()
TWebControl::getHeight()
TWebControl::getStyle()
TWebControl::getTabIndex()
TWebControl::getTagName()
TWebControl::getToolTip()
TWebControl::getWidth()
TWebControl::render()
TWebControl::renderBeginTag()
TWebControl::renderContents()
TWebControl::renderEndTag()
TWebControl::setAccessKey()
TWebControl::setBackColor()
TWebControl::setBorderColor()
TWebControl::setBorderStyle()
TWebControl::setBorderWidth()
TWebControl::setCssClass()
TWebControl::setForeColor()
TWebControl::setHeight()
TWebControl::setStyle()
TWebControl::setTabIndex()
TWebControl::setToolTip()
TWebControl::setWidth()
Inherited From TControl
TControl::__construct()
TControl::addedControl()
TControl::addParsedObject()
TControl::applyStyleSheetSkin()
TControl::autoBindProperty()
TControl::autoDataBindProperties()
TControl::bindProperty()
TControl::broadcastEvent()
TControl::broadcastEventInternal()
TControl::bubbleEvent()
TControl::clearChildState()
TControl::clearControlState()
TControl::clearNamingContainer()
TControl::clearViewState()
TControl::createChildControls()
TControl::createControlCollection()
TControl::createdOnTemplate()
TControl::dataBind()
TControl::dataBindChildren()
TControl::dataBindProperties()
TControl::ensureChildControls()
TControl::findControl()
TControl::findControlsByID()
TControl::findControlsByType()
TControl::focus()
TControl::getAdapter()
TControl::getAllowChildControls()
TControl::getAttribute()
TControl::getAttributes()
TControl::getChildControlsCreated()
TControl::getClientID()
TControl::getControls()
TControl::getControlStage()
TControl::getControlState()
TControl::getEnabled()
TControl::getEnableTheming()
TControl::getEnableViewState()
TControl::getHasAdapter()
TControl::getHasAttributes()
TControl::getHasControls()
TControl::getID()
TControl::getNamingContainer()
TControl::getPage()
TControl::getParent()
TControl::getRegisteredObject()
TControl::getSkinID()
TControl::getSourceTemplateControl()
TControl::getTemplateControl()
TControl::getUniqueID()
TControl::getViewState()
TControl::getVisible()
TControl::hasAttribute()
TControl::initRecursive()
TControl::isDescendentOf()
TControl::isObjectRegistered()
TControl::loadRecursive()
TControl::loadState()
TControl::loadStateRecursive()
TControl::onDataBinding()
TControl::onInit()
TControl::onLoad()
TControl::onPreRender()
TControl::onUnload()
TControl::preRenderRecursive()
TControl::raiseBubbleEvent()
TControl::registerObject()
TControl::removeAttribute()
TControl::removedControl()
TControl::render()
TControl::renderChildren()
TControl::renderControl()
TControl::saveState()
TControl::saveStateRecursive()
TControl::setAdapter()
TControl::setAttribute()
TControl::setChildControlsCreated()
TControl::setControlStage()
TControl::setControlState()
TControl::setEnabled()
TControl::setEnableTheming()
TControl::setEnableViewState()
TControl::setID()
TControl::setPage()
TControl::setSkinID()
TControl::setTemplateControl()
TControl::setViewState()
TControl::setVisible()
TControl::traverseChildControls()
TControl::unbindProperty()
TControl::unloadRecursive()
TControl::unregisterObject()
TControl::__get()
Inherited From TApplicationComponent
TApplicationComponent::getApplication()
TApplicationComponent::getRequest()
TApplicationComponent::getResponse()
TApplicationComponent::getService()
TApplicationComponent::getSession()
TApplicationComponent::getUser()
TApplicationComponent::publishAsset()
TApplicationComponent::publishFilePath()
Inherited From TComponent
TComponent::attachEventHandler()
TComponent::canGetProperty()
TComponent::canSetProperty()
TComponent::detachEventHandler()
TComponent::evaluateExpression()
TComponent::evaluateStatements()
TComponent::getEventHandlers()
TComponent::getSubProperty()
TComponent::hasEvent()
TComponent::hasEventHandler()
TComponent::hasProperty()
TComponent::raiseEvent()
TComponent::setSubProperty()
TComponent::__get()
TComponent::__set()
CMD_CANCEL
= 'Cancel'
(line 157)
CMD_DELETE
= 'Delete'
(line 156)
CMD_EDIT
= 'Edit'
(line 154)
CMD_PAGE
= 'Page'
(line 159)
CMD_PAGE_NEXT
= 'Next'
(line 160)
CMD_PAGE_PREV
= 'Previous'
(line 161)
CMD_SELECT
= 'Select'
(line 153)
Command name that TDataGrid understands.
CMD_SORT
= 'Sort'
(line 158)
CMD_UPDATE
= 'Update'
(line 155)
IT_ALTERNATINGITEM
= 'AlternatingItem'
(line 145)
IT_EDITITEM
= 'EditItem'
(line 146)
IT_FOOTER
= 'Footer'
(line 142)
IT_HEADER
= 'Header'
(line 141)
datagrid item types
IT_ITEM
= 'Item'
(line 143)
IT_PAGER
= 'Pager'
(line 148)
IT_SELECTEDITEM
= 'SelectedItem'
(line 147)
IT_SEPARATOR
= 'Separator'
(line 144)
Inherited from TControl
Documentation generated on Sun, 04 Jun 2006 18:59:02 -0400 by phpDocumentor 1.3.0RC4