TDataGridColumn class
TDataGridColumn serves as the base class for the different column types of the TDataGrid control. TDataGridColumn defines the properties and methods that are common among all datagrid column types. In particular, it initializes header and footer cells according to HeaderText and HeaderStyle FooterText and FooterStyle properties. If HeaderImageUrl is specified, the image will be displayed instead in the header cell. The ItemStyle is applied to cells that belong to non-header and -footer datagrid items.
When the datagrid enables sorting, if the SortExpression is not empty, the header cell will display a button (linkbutton or imagebutton) that will bubble the sort command event to the datagrid.
Since v3.1.0, TDataGridColumn has introduced two new properties HeaderRenderer and FooterRenderer which can be used to specify the layout of header and footer column cells. A renderer refers to a control class that is to be instantiated as a control. For more details, see TRepeater and TDataList.
Since v3.1.1, TDataGridColumn has introduced EnableCellGrouping. If a column has this property set true, consecutive cells having the same content in this column will be grouped into one cell. Note, there are some limitations to cell grouping. We determine the cell content according to the cell's TTableCell::getText property. If the text is empty and the cell has some child controls, we will pick up the first control who implements IDataRenderer and obtain its IDataRenderer::getData property.
The following datagrid column types are provided by the framework currently,
Located in /Web/UI/WebControls/TDataGridColumn.php (line 65)
TComponent | --TApplicationComponent | --TDataGridColumn
Class | Description |
---|---|
TBoundColumn | TBoundColumn class |
TButtonColumn | TButtonColumn class |
TCheckBoxColumn | TCheckBoxColumn class |
TDropDownListColumn | TDropDownListColumn class |
TEditCommandColumn | TEditCommandColumn class |
THyperLinkColumn | THyperLinkColumn class |
TLiteralColumn | TLiteralColumn class |
TTemplateColumn | TTemplateColumn class |
Formats the text value according to a format string.
If the format string is empty, the original value is converted into a string and returned. If the format string starts with '#', the string is treated as a PHP expression within which the token '{0}' is translated with the data value to be formated. Otherwise, the format string and the data value are passed as the first and second parameters in http://www.php.net/sprintf.
Returns a value indicating whether this column allows sorting.
The column allows sorting only when SortExpression is not empty and the datagrid allows sorting.
Fetches the value of the data at the specified field.
If the data is an array, the field is used as an array key. If the data is an of TMap, TList or their derived class, the field is used as a key value. If the data is a component, the field is used as the name of a property.
Returns a viewstate value.
Initializes the column.
This method is invoked by TDataGrid when the column is about to be used to initialize datagrid items. Derived classes may override this method to do additional initialization.
Initializes the specified cell to its initial values.
The default implementation sets the content of header and footer cells. If sorting is enabled by the grid and sort expression is specified in the column, the header cell will show a link/image button. Otherwise, the header/footer cell will only show static text/image. This method can be overriden to provide customized intialization to column cells.
Initializes the footer cell.
This method attempts to use FooterRenderer to instantiate the footer cell. If that is not available, it will populate the cell with a text string specified by getFooterImageUrl
Initializes the header cell.
This method attempts to use HeaderRenderer to instantiate the header cell. If that is not available, it will populate the cell with an image or a text string, depending on HeaderImageUrl and HeaderText property values.
If the column allows sorting, image or text will be created as a button which issues Sort command upon user click.
Loads persistent state values.
Saves persistent state values.
Sets the column footer cell renderer class.
If not empty, the class will be used to instantiate as a child control in the column footer cell. If the class implements IDataRenderer, the Data property will be set as the FooterText.
Sets the column header cell renderer class.
If not empty, the class will be used to instantiate as a child control in the column header cell. If the class implements IDataRenderer, the Data property will be set as the FooterText.
Sets the ID of the column.
By explicitly specifying the column ID, one can access the column by $templateControl->ColumnID.
Sets a viewstate value.
Make sure that the viewstate value must be serializable and unserializable.
Inherited From TApplicationComponent
TApplicationComponent::getApplication()
TApplicationComponent::getRequest()
TApplicationComponent::getResponse()
TApplicationComponent::getService()
TApplicationComponent::getSession()
TApplicationComponent::getUser()
TApplicationComponent::publishAsset()
TApplicationComponent::publishFilePath()
Inherited From TComponent
TComponent::addParsedObject()
TComponent::attachEventHandler()
TComponent::canGetProperty()
TComponent::canSetProperty()
TComponent::createdOnTemplate()
TComponent::detachEventHandler()
TComponent::evaluateExpression()
TComponent::evaluateStatements()
TComponent::getEventHandlers()
TComponent::getSubProperty()
TComponent::hasEvent()
TComponent::hasEventHandler()
TComponent::hasProperty()
TComponent::raiseEvent()
TComponent::setSubProperty()
TComponent::__get()
TComponent::__set()
Documentation generated on Mon, 21 Apr 2008 11:34:31 -0400 by phpDocumentor 1.3.0RC4