PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class TDropDownListColumn

TDropDownListColumn class

TDropDownListColumn represents a column that is bound to a field in a data source. The cells in the column will be displayed using the data indexed by setDataTextField DataTextField. You can customize the display by setting setDataTextFormatString DataTextFormatString.

If setReadOnly ReadOnly is false, TDropDownListColumn will display cells in edit mode with dropdown lists. Otherwise, a static text is displayed. The currently selected dropndown list item is specified by the data indexed with setDataValueField DataValueField.

There are two approaches to specify the list items available for selection. The first approach uses template syntax as follows,

<com:TDropDownListColumn ....>
  <com:TListItem Value="1" Text="first item" />
  <com:TListItem Value="2" Text="second item" />
  <com:TListItem Value="3" Text="third item" />
</com:TDropDownListColumn>

The second approach specifies a data source to be bound to the dropdown lists by setting setListDataSource ListDataSource. Like generic list controls, you may also want to specify which data fields are used for item values and texts by setting setListValueField ListValueField and setListTextField ListTextField, respectively. Furthermore, the item texts may be formatted by using setListTextFormatString ListTextFormatString. Note, if you specify setListDataSource ListDataSource, do it before calling the datagrid's dataBind().

The dropdown list control in the TDropDownListColumn can be accessed by one of the following two methods:

$datagridItem->DropDownListColumnID->DropDownList
$datagridItem->DropDownListColumnID->Controls[0]

The second method is possible because the dropdown list control created within the datagrid cell is the first child.

TComponent
Extended by TApplicationComponent
Extended by TDataGridColumn
Extended by TDropDownListColumn

Direct known subclasses

TActiveDropDownListColumn
Package: System\Web\UI\WebControls
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 3.0.4
Located at Web/UI/WebControls/TDropDownListColumn.php
Methods summary
public
# __construct( )

The common __construct If desired by the new object, this will auto install and listen to global event functions as defined by the object via 'fx' methods. This also attaches any predefined behaviors. This function installs all class behaviors in a class hierarchy from the deepest subclass through each parent to the top most class, TComponent.

The common __construct If desired by the new object, this will auto install and listen to global event functions as defined by the object via 'fx' methods. This also attaches any predefined behaviors. This function installs all class behaviors in a class hierarchy from the deepest subclass through each parent to the top most class, TComponent.

Overrides

TComponent::__construct()
public
# loadState( mixed $state )

Loads items from viewstate. This method overrides the parent implementation by loading list items

Loads items from viewstate. This method overrides the parent implementation by loading list items

Parameters

$state
mixed
state values

Overrides

TDataGridColumn::loadState()
public mixed
# saveState( )

Saves items into viewstate. This method overrides the parent implementation by saving list items

Saves items into viewstate. This method overrides the parent implementation by saving list items

Returns

mixed
values to be saved

Overrides

TDataGridColumn::saveState()
public
# addParsedObject( mixed $object )

Adds object parsed from template to the control. This method adds only TListItem objects into the getItems Items collection. All other objects are ignored.

Adds object parsed from template to the control. This method adds only TListItem objects into the getItems Items collection. All other objects are ignored.

Parameters

$object
mixed
object parsed from template

Overrides

TComponent::addParsedObject()
public string
# getDataTextField( )

Returns

string
the field of the data source that provides the text content of the column.
public
# setDataTextField( string $value )

Sets the field of the data source that provides the text content of the column. If this is not set, the data specified via getDataValueField DataValueField will be displayed in the column.

Sets the field of the data source that provides the text content of the column. If this is not set, the data specified via getDataValueField DataValueField will be displayed in the column.

Parameters

$value
string
the field of the data source that provides the text content of the column.
public string
# getDataTextFormatString( )

Returns

string
the formatting string used to control how the bound data will be displayed.
public
# setDataTextFormatString( string $value )

Parameters

$value
string
the formatting string used to control how the bound data will be displayed.
public string
# getDataValueField( )

Returns

string
the field of the data source that provides the key selecting an item in dropdown list.
public
# setDataValueField( string $value )

Sets the field of the data source that provides the key selecting an item in dropdown list. If this is not present, the data specified via getDataTextField DataTextField (without applying the formatting string) will be used for selection, instead.

Sets the field of the data source that provides the key selecting an item in dropdown list. If this is not present, the data specified via getDataTextField DataTextField (without applying the formatting string) will be used for selection, instead.

Parameters

$value
string
the field of the data source that provides the key selecting an item in dropdown list.
public boolean
# getReadOnly( )

Returns

boolean
whether the items in the column can be edited. Defaults to false.
public
# setReadOnly( boolean $value )

Parameters

$value
boolean
whether the items in the column can be edited
public Traversable
# getListDataSource( )

Returns

Traversable
data source to be bound to the dropdown list boxes.
public
# setListDataSource( Traversable|array|string $value )

Parameters

$value
Traversable|array|string
data source to be bound to the dropdown list boxes.
public string
# getListValueField( )

Returns

string
the data field used to populate the values of the dropdown list items. Defaults to empty.
public
# setListValueField( string $value )

Parameters

$value
string
the data field used to populate the values of the dropdown list items
public string
# getListTextField( )

Returns

string
the data field used to populate the texts of the dropdown list items. Defaults to empty.
public
# setListTextField( string $value )

Parameters

$value
string
the data field used to populate the texts of the dropdown list items
public string
# getListTextFormatString( )

Returns

string
the formatting string used to control how the list item texts will be displayed.
public
# setListTextFormatString( string $value )

Parameters

$value
string
the formatting string used to control how the list item texts will be displayed.
public
# initializeCell( TTableCell $cell, integer $columnIndex, string $itemType )

Initializes the specified cell to its initial values. This method overrides the parent implementation. It creates a textbox for item in edit mode and the column is not read-only. Otherwise it displays a static text. The caption of the button and the static text are retrieved from the datasource.

Initializes the specified cell to its initial values. This method overrides the parent implementation. It creates a textbox for item in edit mode and the column is not read-only. Otherwise it displays a static text. The caption of the button and the static text are retrieved from the datasource.

Parameters

$cell
TTableCell
the cell to be initialized.
$columnIndex
integer
the index to the Columns property that the cell resides in.
$itemType
string
the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem)

Overrides

TDataGridColumn::initializeCell()
public
# dataBindColumn( mixed $sender, mixed $param )

Databinds a cell in the column. This method is invoked when datagrid performs databinding. It populates the content of the cell with the relevant data from data source.

Databinds a cell in the column. This method is invoked when datagrid performs databinding. It populates the content of the cell with the relevant data from data source.

Methods inherited from TDataGridColumn
formatDataValue(), getAllowSorting(), getDataFieldValue(), getEnableCellGrouping(), getFooterRenderer(), getFooterStyle(), getFooterText(), getHeaderImageUrl(), getHeaderRenderer(), getHeaderStyle(), getHeaderText(), getID(), getItemStyle(), getOwner(), getSortExpression(), getViewState(), getVisible(), initialize(), initializeFooterCell(), initializeHeaderCell(), setEnableCellGrouping(), setFooterRenderer(), setFooterText(), setHeaderImageUrl(), setHeaderRenderer(), setHeaderText(), setID(), setOwner(), setSortExpression(), setViewState(), setVisible()
Methods inherited from TApplicationComponent
getApplication(), getRequest(), getResponse(), getService(), getSession(), getUser(), publishAsset(), publishFilePath()
Methods inherited from TComponent
__call(), __destruct(), __get(), __isset(), __set(), __sleep(), __unset(), __wakeup(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO