From 304427074ddf629fd2708b23a3fe0cd0122c05a8 Mon Sep 17 00:00:00 2001
From: xue <>
Date: Sun, 27 Aug 2006 14:45:57 +0000
Subject: Cells in TDataGrid rows can now be accessed via the corresponding
column IDs. Input controls in some datagrid columns can now be accessed in a
named fashion.
---
.../pages/Controls/Samples/TDataGrid/Sample3.page | 7 ++++++-
.../pages/Controls/Samples/TDataGrid/Sample3.php | 16 ++++++++--------
2 files changed, 14 insertions(+), 9 deletions(-)
(limited to 'demos/quickstart/protected/pages')
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample3.page b/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample3.page
index 2864de46..96affa4a 100644
--- a/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample3.page
+++ b/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample3.page
@@ -23,16 +23,19 @@
>
-
+
@@ -70,6 +74,7 @@
ItemStyle.Font.Italic="false"
/>
ItemType==='EditItem')
{
// set column width of textboxes
- $item->Cells[0]->Controls[0]->Columns=40;
- $item->Cells[2]->Controls[0]->Columns=5;
+ $item->BookTitleColumn->TextBox->Columns=40;
+ $item->PriceColumn->TextBox->Columns=5;
}
if($item->ItemType==='Item' || $item->ItemType==='AlternatingItem' || $item->ItemType==='EditItem')
{
// add an aleart dialog to delete buttons
- $item->Cells[6]->Controls[0]->Attributes->onclick='if(!confirm(\'Are you sure?\')) return false;';
+ $item->DeleteColumn->Button->Attributes->onclick='if(!confirm(\'Are you sure?\')) return false;';
}
}
@@ -160,11 +160,11 @@ class Sample3 extends TPage
$item=$param->Item;
$this->updateBook(
$this->DataGrid->DataKeys[$item->ItemIndex], // ISBN
- $item->Cells[0]->Controls[0]->Text, // title
- $item->Cells[1]->Controls[0]->Text, // publisher
- $item->Cells[2]->Controls[0]->Text, // price
- $item->Cells[3]->Controls[0]->Checked, // instock
- $item->Cells[4]->Rating->SelectedValue // rating
+ $item->BookTitleColumn->TextBox->Text, // title
+ $item->PublisherColumn->TextBox->Text, // publisher
+ $item->PriceColumn->TextBox->Text, // price
+ $item->InStockColumn->CheckBox->Checked, // instock
+ $item->RatingColumn->Rating->SelectedValue // rating
);
$this->DataGrid->EditItemIndex=-1;
$this->DataGrid->DataSource=$this->Data;
--
cgit v1.2.3