From 8aa0d56705a71894a80c1293730b6c67cddc8a40 Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Thu, 2 Jun 2011 09:30:55 +0000 Subject: added documentation for TActiveDataList, TActiveDataGrid and TActiveRepeater class --- .../pages/ActiveControls/ActiveDataGrid.page | 83 +++++++++ .../pages/ActiveControls/ActiveDataList.page | 23 +++ .../pages/ActiveControls/ActiveRepeater.page | 24 +++ .../protected/pages/ActiveControls/Home.page | 6 +- .../Samples/TActiveDataGrid/Sample1.page | 18 ++ .../Samples/TActiveDataGrid/Sample1.php | 37 ++++ .../Samples/TActiveDataGrid/Sample2.page | 64 +++++++ .../Samples/TActiveDataGrid/Sample2.php | 86 ++++++++++ .../Samples/TActiveDataGrid/Sample3.page | 83 +++++++++ .../Samples/TActiveDataGrid/Sample3.php | 190 +++++++++++++++++++++ .../Samples/TActiveDataGrid/Sample4.page | 55 ++++++ .../Samples/TActiveDataGrid/Sample4.php | 21 +++ .../Samples/TActiveDataGrid/Sample5.page | 25 +++ .../Samples/TActiveDataGrid/Sample5.php | 79 +++++++++ .../Samples/TActiveDataList/Home.page | 125 ++++++++++++++ .../Samples/TActiveDataList/Home.php | 132 ++++++++++++++ .../Samples/TActiveRepeater/Home.page | 92 ++++++++++ .../Samples/TActiveRepeater/Home.php | 79 +++++++++ .../protected/pages/Controls/DataGrid.page | 3 +- .../protected/pages/Controls/DataList.page | 2 + .../protected/pages/Controls/Repeater.page | 1 + 21 files changed, 1224 insertions(+), 4 deletions(-) create mode 100644 demos/quickstart/protected/pages/ActiveControls/ActiveDataGrid.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/ActiveDataList.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/ActiveRepeater.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample1.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample1.php create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample2.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample2.php create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample3.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample3.php create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.php create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample5.php create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataList/Home.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataList/Home.php create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Home.page create mode 100644 demos/quickstart/protected/pages/ActiveControls/Samples/TActiveRepeater/Home.php (limited to 'demos/quickstart/protected') diff --git a/demos/quickstart/protected/pages/ActiveControls/ActiveDataGrid.page b/demos/quickstart/protected/pages/ActiveControls/ActiveDataGrid.page new file mode 100644 index 00000000..9a82743d --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/ActiveDataGrid.page @@ -0,0 +1,83 @@ + + +

TActiveDataGrid

+ + +

+TActiveDataGrid represents a data bound and updatable grid control which is the +active counterpart to the original TDataGrid control. +

+ +

+This component can be used in the same way as the regular datagrid, the only +difference is that the active datagrid uses callbacks instead of postbacks +for interaction. +

+ +

+PRADO provides eight new types of active columns that can be used inside TActiveDataGrid; +they are the active counterpart of TDataGrid's columns: +

+ + +

+Please refer to the original documentation of TDataGrid for basic usage. +

+ + +

Columns

+ +

Automatically Generated Columns

+

+TDataGrid by default will create a list of columns based on the structure of the bound data. TDataGrid will read the first row of the data, extract the field names of the row, and construct a column for each field. Each column is of type TActiveBoundColumn. All of this happens in an ajax callback. +

+ + + +

Manually Specified Columns

+

+The following example uses manually specified columns to show a list of book information, +

+
    +
  • Book title - displayed as a hyperlink pointing to the corresponding amazon.com book page. TActiveHyperLinkColumn is used.
  • +
  • Publisher - displayed as a piece of text using TvBoundColumn.
  • +
  • Price - displayed as a piece of text using TActiveBoundColumn with output formatting string and customized styles.
  • +
  • In-stock or not - displayed as a checkbox using TActiveCheckBoxColumn.
  • +
  • Rating - displayed as an image using TActiveTemplateColumn which allows maximum freedom in specifying cell contents.
  • +
+

+Each column can be shown or hidden in a callback. +

+ + + +

Interacting with TActiveDataGrid

+

+The following example shows how to make the previous book information table an interactive one. It allows users to edit and delete book items from the table. Two additional columns are used in the example to allow users interact with the datagrid: TActiveEditCommandColumn and TActiveButtonColumn. In addition, +TActiveDropDownListColumn replaces the previous TActiveTemplateColumn to allow users to select a rating from a dropdown list. Note, it is also possible to use TActiveTemplateColumn to achieve the same task. +All the iteration is done using AJAX callbacks. +

+ + +

Sorting

+

+The following example turns the datagrid in Example 2 into a sortable one. Users can click on the link button displayed in the header of any column, and the data will be sorted in ascending order along that column. The grid is sorted and rendered upon a callback request. +

+ + +

Paging

+

+The following example enables the paging functionality of the datagrid shown in Example 1. In this example, you move between the datagrid pages clicking on the pager links. The grid reacts to paging rendering itself as the result of a callback request. Note that you can't change the pager style upon callback. +

+ + +
$Id$
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/ActiveDataList.page b/demos/quickstart/protected/pages/ActiveControls/ActiveDataList.page new file mode 100644 index 00000000..12fb941f --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/ActiveDataList.page @@ -0,0 +1,23 @@ + + +

TActiveDataList

+ + +

+TActiveDataList represents a data bound and updatable list control which is the +active counterpart to the original TDataList control. +

+ +

+This component can be used in the same way as the regular datalist, the only +difference is that the active datalist uses callbacks instead of postbacks +for interaction. +

+ +

+Please refer to the original documentation of TDataList for usage. +

+ + + +
$Id$
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/ActiveRepeater.page b/demos/quickstart/protected/pages/ActiveControls/ActiveRepeater.page new file mode 100644 index 00000000..d22a7467 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/ActiveRepeater.page @@ -0,0 +1,24 @@ + + +

TActiveRepeater

+ + +

+TActiveRepeater represents a data bound and updatable repeater control which is the +active counterpart to the original TRepeater control. +

+ +

+This component can be used in the same way as the regular repeater, the only +difference is that the active repeater uses callbacks instead of postbacks +for interaction. +

+ +

+Please refer to the original documentation of TRepeater for usage. +

+ + + + +
$Id$
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/ActiveControls/Home.page b/demos/quickstart/protected/pages/ActiveControls/Home.page index 93b5b6eb..798bc267 100644 --- a/demos/quickstart/protected/pages/ActiveControls/Home.page +++ b/demos/quickstart/protected/pages/ActiveControls/Home.page @@ -136,19 +136,19 @@ TActiveButton control. See also the later part of the Active Data Controls