diff options
Diffstat (limited to 'framework/Web/UI/WebControls/TDataGrid.php')
-rw-r--r-- | framework/Web/UI/WebControls/TDataGrid.php | 575 |
1 files changed, 1 insertions, 574 deletions
diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php index 96e799aa..685c2b5b 100644 --- a/framework/Web/UI/WebControls/TDataGrid.php +++ b/framework/Web/UI/WebControls/TDataGrid.php @@ -1668,577 +1668,4 @@ class TDataGrid extends TBaseDataList implements INamingContainer $writer->writeLine(); $this->renderEndTag($writer); } -} - -/** - * TDataGridItemEventParameter class - * - * TDataGridItemEventParameter encapsulates the parameter data for - * {@link TDataGrid::onItemCreated OnItemCreated} event of {@link TDataGrid} controls. - * The {@link getItem Item} property indicates the datagrid item related with the event. - * - * @author Qiang Xue <qiang.xue@gmail.com> - * @package System.Web.UI.WebControls - * @since 3.0 - */ -class TDataGridItemEventParameter extends TEventParameter -{ - /** - * The TDataGridItem control responsible for the event. - * @var TDataGridItem - */ - private $_item=null; - - /** - * Constructor. - * @param TDataGridItem datagrid item related with the corresponding event - */ - public function __construct(TDataGridItem $item) - { - $this->_item=$item; - } - - /** - * @return TDataGridItem datagrid item related with the corresponding event - */ - public function getItem() - { - return $this->_item; - } -} - -/** - * TDataGridPagerEventParameter class - * - * TDataGridPagerEventParameter encapsulates the parameter data for - * {@link TDataGrid::onPagerCreated OnPagerCreated} event of {@link TDataGrid} controls. - * The {@link getPager Pager} property indicates the datagrid pager related with the event. - * - * @author Qiang Xue <qiang.xue@gmail.com> - * @package System.Web.UI.WebControls - * @since 3.0 - */ -class TDataGridPagerEventParameter extends TEventParameter -{ - /** - * The TDataGridPager control responsible for the event. - * @var TDataGridPager - */ - protected $_pager=null; - - /** - * Constructor. - * @param TDataGridPager datagrid pager related with the corresponding event - */ - public function __construct(TDataGridPager $pager) - { - $this->_pager=$pager; - } - - /** - * @return TDataGridPager datagrid pager related with the corresponding event - */ - public function getPager() - { - return $this->_pager; - } -} - -/** - * TDataGridCommandEventParameter class - * - * TDataGridCommandEventParameter encapsulates the parameter data for - * {@link TDataGrid::onItemCommand ItemCommand} event of {@link TDataGrid} controls. - * - * The {@link getItem Item} property indicates the datagrid item related with the event. - * The {@link getCommandSource CommandSource} refers to the control that originally - * raises the Command event. - * - * @author Qiang Xue <qiang.xue@gmail.com> - * @package System.Web.UI.WebControls - * @since 3.0 - */ -class TDataGridCommandEventParameter extends TCommandEventParameter -{ - /** - * @var TDataGridItem the TDataGridItem control responsible for the event. - */ - private $_item=null; - /** - * @var TControl the control originally raises the <b>Command</b> event. - */ - private $_source=null; - - /** - * Constructor. - * @param TDataGridItem datagrid item responsible for the event - * @param TControl original event sender - * @param TCommandEventParameter original event parameter - */ - public function __construct($item,$source,TCommandEventParameter $param) - { - $this->_item=$item; - $this->_source=$source; - parent::__construct($param->getCommandName(),$param->getCommandParameter()); - } - - /** - * @return TDataGridItem the TDataGridItem control responsible for the event. - */ - public function getItem() - { - return $this->_item; - } - - /** - * @return TControl the control originally raises the <b>Command</b> event. - */ - public function getCommandSource() - { - return $this->_source; - } -} - -/** - * TDataGridSortCommandEventParameter class - * - * TDataGridSortCommandEventParameter encapsulates the parameter data for - * {@link TDataGrid::onSortCommand SortCommand} event of {@link TDataGrid} controls. - * - * The {@link getCommandSource CommandSource} property refers to the control - * that originally raises the OnCommand event, while {@link getSortExpression SortExpression} - * gives the sort expression carried with the sort command. - * - * @author Qiang Xue <qiang.xue@gmail.com> - * @package System.Web.UI.WebControls - * @since 3.0 - */ -class TDataGridSortCommandEventParameter extends TEventParameter -{ - /** - * @var string sort expression - */ - private $_sortExpression=''; - /** - * @var TControl original event sender - */ - private $_source=null; - - /** - * Constructor. - * @param TControl the control originally raises the <b>OnCommand</b> event. - * @param TDataGridCommandEventParameter command event parameter - */ - public function __construct($source,TDataGridCommandEventParameter $param) - { - $this->_source=$source; - $this->_sortExpression=$param->getCommandParameter(); - } - - /** - * @return TControl the control originally raises the <b>OnCommand</b> event. - */ - public function getCommandSource() - { - return $this->_source; - } - - /** - * @return string sort expression - */ - public function getSortExpression() - { - return $this->_sortExpression; - } -} - -/** - * TDataGridPageChangedEventParameter class - * - * TDataGridPageChangedEventParameter encapsulates the parameter data for - * {@link TDataGrid::onPageIndexChanged PageIndexChanged} event of {@link TDataGrid} controls. - * - * The {@link getCommandSource CommandSource} property refers to the control - * that originally raises the OnCommand event, while {@link getNewPageIndex NewPageIndex} - * returns the new page index carried with the page command. - * - * @author Qiang Xue <qiang.xue@gmail.com> - * @package System.Web.UI.WebControls - * @since 3.0 - */ -class TDataGridPageChangedEventParameter extends TEventParameter -{ - /** - * @var integer new page index - */ - private $_newIndex; - /** - * @var TControl original event sender - */ - private $_source=null; - - /** - * Constructor. - * @param TControl the control originally raises the <b>OnCommand</b> event. - * @param integer new page index - */ - public function __construct($source,$newPageIndex) - { - $this->_source=$source; - $this->_newIndex=$newPageIndex; - } - - /** - * @return TControl the control originally raises the <b>OnCommand</b> event. - */ - public function getCommandSource() - { - return $this->_source; - } - - /** - * @return integer new page index - */ - public function getNewPageIndex() - { - return $this->_newIndex; - } -} - -/** - * TDataGridItem class - * - * A TDataGridItem control represents an item in the {@link TDataGrid} control, - * such as heading section, footer section, or a data item. - * The index and data value of the item can be accessed via {@link getItemIndex ItemIndex}> - * and {@link getDataItem DataItem} properties, respectively. The type of the item - * is given by {@link getItemType ItemType} property. Property {@link getDataSourceIndex DataSourceIndex} - * gives the index of the item from the bound data source. - * - * @author Qiang Xue <qiang.xue@gmail.com> - * @package System.Web.UI.WebControls - * @since 3.0 - */ -class TDataGridItem extends TTableRow implements INamingContainer -{ - /** - * @var integer index of the data item in the Items collection of datagrid - */ - private $_itemIndex=''; - /** - * @var integer index of the item from the bound data source - */ - private $_dataSourceIndex=0; - /** - * type of the TDataGridItem - * @var string - */ - private $_itemType=''; - /** - * value of the data item - * @var mixed - */ - private $_data=null; - - /** - * Constructor. - * @param integer zero-based index of the item in the item collection of datagrid - * @param TListItemType item type - */ - public function __construct($itemIndex,$dataSourceIndex,$itemType) - { - $this->_itemIndex=$itemIndex; - $this->_dataSourceIndex=$dataSourceIndex; - $this->setItemType($itemType); - if($itemType===TListItemType::Header) - $this->setTableSection(TTableRowSection::Header); - else if($itemType===TListItemType::Footer) - $this->setTableSection(TTableRowSection::Footer); - } - - /** - * @return TListItemType item type. - */ - public function getItemType() - { - return $this->_itemType; - } - - /** - * @param TListItemType item type - */ - public function setItemType($value) - { - $this->_itemType=TPropertyValue::ensureEnum($value,'TListItemType'); - } - - /** - * @return integer zero-based index of the item in the item collection of datagrid - */ - public function getItemIndex() - { - return $this->_itemIndex; - } - - /** - * @return integer the index of the datagrid item from the bound data source - */ - public function getDataSourceIndex() - { - return $this->_dataSourceIndex; - } - - /** - * @return mixed data associated with the item - * @since 3.1.0 - */ - public function getData() - { - return $this->_data; - } - - /** - * @param mixed data to be associated with the item - * @since 3.1.0 - */ - public function setData($value) - { - $this->_data=$value; - } - - /** - * This property is deprecated since v3.1.0. - * @return mixed data associated with the item - * @deprecated deprecated since v3.1.0. Use {@link getData} instead. - */ - public function getDataItem() - { - return $this->getData(); - } - - /** - * This property is deprecated since v3.1.0. - * @param mixed data to be associated with the item - * @deprecated deprecated since version 3.1.0. Use {@link setData} instead. - */ - public function setDataItem($value) - { - return $this->setData($value); - } - - /** - * This method overrides parent's implementation by wrapping event parameter - * for <b>OnCommand</b> event with item information. - * @param TControl the sender of the event - * @param TEventParameter event parameter - * @return boolean whether the event bubbling should stop here. - */ - public function bubbleEvent($sender,$param) - { - if($param instanceof TCommandEventParameter) - { - $this->raiseBubbleEvent($this,new TDataGridCommandEventParameter($this,$sender,$param)); - return true; - } - else - return false; - } -} - - -/** - * TDataGridPager class. - * - * TDataGridPager represents a datagrid pager. - * - * @author Qiang Xue <qiang.xue@gmail.com> - * @package System.Web.UI.WebControls - * @since 3.0 - */ -class TDataGridPager extends TPanel implements INamingContainer -{ - private $_dataGrid; - - /** - * Constructor. - * @param TDataGrid datagrid object - */ - public function __construct($dataGrid) - { - $this->_dataGrid=$dataGrid; - } - - /** - * This method overrides parent's implementation by wrapping event parameter - * for <b>OnCommand</b> event with item information. - * @param TControl the sender of the event - * @param TEventParameter event parameter - * @return boolean whether the event bubbling should stop here. - */ - public function bubbleEvent($sender,$param) - { - if($param instanceof TCommandEventParameter) - { - $this->raiseBubbleEvent($this,new TDataGridCommandEventParameter($this,$sender,$param)); - return true; - } - else - return false; - } - - /** - * @return TDataGrid the datagrid owning this pager - */ - public function getDataGrid() - { - return $this->_dataGrid; - } - - /** - * @return string item type. - */ - public function getItemType() - { - return TListItemType::Pager; - } -} - - -/** - * TDataGridItemCollection class. - * - * TDataGridItemCollection represents a collection of data grid items. - * - * @author Qiang Xue <qiang.xue@gmail.com> - * @package System.Web.UI.WebControls - * @since 3.0 - */ -class TDataGridItemCollection extends TList -{ - /** - * Inserts an item at the specified position. - * This overrides the parent implementation by inserting only TDataGridItem. - * @param integer the speicified position. - * @param mixed new item - * @throws TInvalidDataTypeException if the item to be inserted is not a TDataGridItem. - */ - public function insertAt($index,$item) - { - if($item instanceof TDataGridItem) - parent::insertAt($index,$item); - else - throw new TInvalidDataTypeException('datagriditemcollection_datagriditem_required'); - } -} - -/** - * TDataGridColumnCollection class. - * - * TDataGridColumnCollection represents a collection of data grid columns. - * - * @author Qiang Xue <qiang.xue@gmail.com> - * @package System.Web.UI.WebControls - * @since 3.0 - */ -class TDataGridColumnCollection extends TList -{ - /** - * the control that owns this collection. - * @var TControl - */ - private $_o; - - /** - * Constructor. - * @param TDataGrid the control that owns this collection. - */ - public function __construct(TDataGrid $owner) - { - $this->_o=$owner; - } - - /** - * @return TDataGrid the control that owns this collection. - */ - protected function getOwner() - { - return $this->_o; - } - - /** - * Inserts an item at the specified position. - * This overrides the parent implementation by inserting only TDataGridColumn. - * @param integer the speicified position. - * @param mixed new item - * @throws TInvalidDataTypeException if the item to be inserted is not a TDataGridColumn. - */ - public function insertAt($index,$item) - { - if($item instanceof TDataGridColumn) - { - $item->setOwner($this->_o); - parent::insertAt($index,$item); - } - else - throw new TInvalidDataTypeException('datagridcolumncollection_datagridcolumn_required'); - } -} - -/** - * TDataGridPagerMode class. - * TDataGridPagerMode defines the enumerable type for the possible modes that a datagrid pager can take. - * - * The following enumerable values are defined: - * - NextPrev: pager buttons are displayed as next and previous pages - * - Numeric: pager buttons are displayed as numeric page numbers - * - * @author Qiang Xue <qiang.xue@gmail.com> - * @package System.Web.UI.WebControls - * @since 3.0.4 - */ -class TDataGridPagerMode extends TEnumerable -{ - const NextPrev='NextPrev'; - const Numeric='Numeric'; -} - - -/** - * TDataGridPagerButtonType class. - * TDataGridPagerButtonType defines the enumerable type for the possible types of datagrid pager buttons. - * - * The following enumerable values are defined: - * - LinkButton: link buttons - * - PushButton: form submit buttons - * - * @author Qiang Xue <qiang.xue@gmail.com> - * @package System.Web.UI.WebControls - * @since 3.0.4 - */ -class TDataGridPagerButtonType extends TEnumerable -{ - const LinkButton='LinkButton'; - const PushButton='PushButton'; -} - - -/** - * TDataGridPagerPosition class. - * TDataGridPagerPosition defines the enumerable type for the possible positions that a datagrid pager can be located at. - * - * The following enumerable values are defined: - * - Bottom: pager appears only at the bottom of the data grid. - * - Top: pager appears only at the top of the data grid. - * - TopAndBottom: pager appears on both top and bottom of the data grid. - * - * @author Qiang Xue <qiang.xue@gmail.com> - * @package System.Web.UI.WebControls - * @since 3.0.4 - */ -class TDataGridPagerPosition extends TEnumerable -{ - const Bottom='Bottom'; - const Top='Top'; - const TopAndBottom='TopAndBottom'; -} - +}
\ No newline at end of file |