+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. +
+ + ++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. +
+ ++The following example uses manually specified columns to show a list of book information, +
++Each column can be shown or hidden in a callback. +
++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. +
++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. +
++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. +
++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. +
+ ++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 | Name | Quantity | Price | +
---|---|---|---|
<%#$this->DataItem['id'] %> | +<%#$this->DataItem['name'] %> | +<%#$this->DataItem['quantity'] %> | +$<%#$this->DataItem['price'] %> | +
+ |
+
ID | +<%#$this->DataItem['id']%> | +
Name | +|
Quantity | +|
Price | +|
Imported | +|
+ |
+
+The following example allows users to modify the existing tabular data using a TActiveRepeater. Two validators are used in the repeater to ensure the validity of user inputs. One is to ensure product names are not empty, the other ensures product prices are valid numeric format. After clicking on the save button, the input data is displayed in a table at the bottom of the page. +
+ +Name | +Category | +Price | +Imported | +
---|---|---|---|
+ |
+
+ |
+
+ |
+
+ |
+
ID | +Name | +Category | +Price | +Imported | +
---|---|---|---|---|
<%#$this->Data['id']%> | +<%#$this->Data['name']%> | +<%#$this->Data['category']%> | +<%#$this->Data['price']%> | +<%#$this->Data['imported']?'Yes':'No'%> | +
Computer Parts Inventory | +
TDatagrid is an important control in building complex Web applications. It displays data in a tabular format with rows (also called items) and columns. A row is composed by cells, while columns govern how cells should be displayed according to their association with the columns. Data specified via DataSource or DataSourceID are bound to the rows and feed contents to cells. @@ -17,7 +18,7 @@ Rows of TDataGrid can be accessed via its Items property. A row (item) Columns of a data grid determine how the associated cells are displayed. For example, cells associated with a TBoundColumn are displayed differently according to their modes. A cell is displayed as a static text if the cell is in browsing mode, a text box if it is in editing mode, and so on.
-PRADO provides five types of columns: +PRADO provides eight types of columns:
TDataList represents a data bound and updatable list control. Like TRepeater, TDataList displays its content repeatedly based on the data fetched from DataSource. The repeated contents in TDataList are called items, which are controls and can be accessed through Items. When dataBind() is invoked, TDataList creates an item for each row of data and binds the data row to the item. Optionally, a TDataList can have a header, a footer and/or separators between items.
diff --git a/demos/quickstart/protected/pages/Controls/Repeater.page b/demos/quickstart/protected/pages/Controls/Repeater.page index 1e2ac881..459f8767 100644 --- a/demos/quickstart/protected/pages/Controls/Repeater.page +++ b/demos/quickstart/protected/pages/Controls/Repeater.page @@ -1,6 +1,7 @@TRepeater displays its content repeatedly based on the data fetched from DataSource. The repeated contents in TRepeater are called items which are controls accessible through Items property. When dataBind() is invoked, TRepeater creates an item for each row of data and binds the data row to the item. Optionally, a repeater can have a header, a footer and/or separators between items. -- cgit v1.2.3