[ Index ]
 

Code source de PRADO 3.0.6

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/framework/Web/UI/WebControls/ -> TDropDownListColumn.php (sommaire)

TDropDownListColumn class file

Author: Qiang Xue <qiang.xue@gmail.com>
Copyright: Copyright © 2006 PradoSoft
License: http://www.pradosoft.com/license/
Version: $Id: TDropDownListColumn.php 1451 2006-09-30 13:10:16Z xue $
Poids: 320 lignes (11 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

TDropDownListColumn:: (22 méthodes):
  __construct()
  loadState()
  saveState()
  addParsedObject()
  getDataTextField()
  setDataTextField()
  getDataTextFormatString()
  setDataTextFormatString()
  getDataValueField()
  setDataValueField()
  getReadOnly()
  setReadOnly()
  getListDataSource()
  setListDataSource()
  getListValueField()
  setListValueField()
  getListTextField()
  setListTextField()
  getListTextFormatString()
  setListTextFormatString()
  initializeCell()
  dataBindColumn()


Classe: TDropDownListColumn  - X-Ref

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
{@link setDataTextField DataTextField}. You can customize the display by
setting {@link setDataTextFormatString DataTextFormatString}.

If {@link 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
{@link setDataValueField DataValueField}.

There are two approaches to specify the list items available for selection.
The first approach uses template syntax as follows,
<code>
<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>
</code>
The second approach specifies a data source to be bound to the dropdown lists
by setting {@link setListDataSource ListDataSource}. Like generic list controls,
you may also want to specify which data fields are used for item values and texts
by setting {@link setListValueField ListValueField} and
{@link setListTextField ListTextField}, respectively.
Furthermore, the item texts may be formatted by using {@link setListTextFormatString ListTextFormatString}.
Note, if you specify {@link 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:
<code>
$datagridItem->DropDownListColumnID->DropDownList
$datagridItem->DropDownListColumnID->Controls[0]
</code>
The second method is possible because the dropdown list control created within the
datagrid cell is the first child.

__construct()   X-Ref
Pas de description

loadState($state)   X-Ref
Loads items from viewstate.
This method overrides the parent implementation by loading list items

param: mixed state values

saveState()   X-Ref
Saves items into viewstate.
This method overrides the parent implementation by saving list items


addParsedObject($object)   X-Ref
Adds object parsed from template to the control.
This method adds only {@link TListItem} objects into the {@link getItems Items} collection.
All other objects are ignored.

param: mixed object parsed from template

getDataTextField()   X-Ref

return: string the field of the data source that provides the text content of the column.

setDataTextField($value)   X-Ref
Sets the field of the data source that provides the text content of the column.
If this is not set, the data specified via {@link getDataValueField DataValueField}
will be displayed in the column.

param: string the field of the data source that provides the text content of the column.

getDataTextFormatString()   X-Ref

return: string the formatting string used to control how the bound data will be displayed.

setDataTextFormatString($value)   X-Ref

param: string the formatting string used to control how the bound data will be displayed.

getDataValueField()   X-Ref

return: string the field of the data source that provides the key selecting an item in dropdown list.

setDataValueField($value)   X-Ref
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 {@link getDataTextField DataTextField} (without
applying the formatting string) will be used for selection, instead.

param: string the field of the data source that provides the key selecting an item in dropdown list.

getReadOnly()   X-Ref

return: boolean whether the items in the column can be edited. Defaults to false.

setReadOnly($value)   X-Ref

param: boolean whether the items in the column can be edited

getListDataSource()   X-Ref

return: Traversable data source to be bound to the dropdown list boxes.

setListDataSource($value)   X-Ref

param: Traversable|array|string data source to be bound to the dropdown list boxes.

getListValueField()   X-Ref

return: string the data field used to populate the values of the dropdown list items. Defaults to empty.

setListValueField($value)   X-Ref

param: string the data field used to populate the values of the dropdown list items

getListTextField()   X-Ref

return: string the data field used to populate the texts of the dropdown list items. Defaults to empty.

setListTextField($value)   X-Ref

param: string the data field used to populate the texts of the dropdown list items

getListTextFormatString()   X-Ref

return: string the formatting string used to control how the list item texts will be displayed.

setListTextFormatString($value)   X-Ref

param: string the formatting string used to control how the list item texts will be displayed.

initializeCell($cell,$columnIndex,$itemType)   X-Ref
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.

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

dataBindColumn($sender,$param)   X-Ref
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.




Généré le : Sun Feb 25 21:07:04 2007 par Balluche grâce à PHPXref 0.7