diff options
author | xue <> | 2006-08-27 23:26:55 +0000 |
---|---|---|
committer | xue <> | 2006-08-27 23:26:55 +0000 |
commit | c1937cccd0985e86e247287faa9ac60870feecd7 (patch) | |
tree | 95ec7083c7be815184c74cd8aa27d02a69d2ea77 /demos/quickstart/protected/pages/Controls/Samples | |
parent | 887da1b3668499821f046665b461aeadb0a9fb2e (diff) |
Merge from 3.0 branch till 1350.
Diffstat (limited to 'demos/quickstart/protected/pages/Controls/Samples')
3 files changed, 23 insertions, 18 deletions
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page index e96e7c12..2bfb1a28 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page +++ b/demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page @@ -4,16 +4,16 @@ <com:TTextBox ID="text1" />
<com:TRequiredFieldValidator
ID="validator1"
- ControlToValidate="text1"
+ ControlToValidate="text1"
ErrorMessage="Text 1 is required" />
<div>
<com:TCheckBox ID="check1" Text="More..." />
</div>
-
- <com:TPanel ID="panel1" Style="display:none" >
+
+ <com:TPanel ID="panel1" Style="display:none" >
<com:TLabel ForControl="text2" Text="Text 2:" />
<com:TTextBox ID="text2" />
-
+
<com:TRequiredFieldValidator
ID="validator2"
ControlToValidate="text2"
@@ -21,14 +21,14 @@ OnPreRender="validate2_onPostValidate"
ErrorMessage="Text 2 is required">
<prop:ClientSide.OnValidate>
- validator.enabled = $("<%= $this->check1->ClientID %>").checked;
+ sender.enabled = $("<%= $this->check1->ClientID %>").checked;
</prop:ClientSide.OnValidate>
- </com:TRequiredFieldValidator>
-
+ </com:TRequiredFieldValidator>
+
</com:TPanel>
-
+
<com:TButton ID="button1" Text="Submit!" />
-
+
<com:TClientScript>
Event.OnLoad(function()
{
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 @@ >
<com:TBoundColumn
+ ID="BookTitleColumn"
HeaderText="Book Title"
HeaderStyle.Width="400px"
DataField="title"
/>
<com:TBoundColumn
+ ID="PublisherColumn"
HeaderText="Publisher"
HeaderStyle.Width="150px"
DataField="publisher"
/>
<com:TBoundColumn
+ ID="PriceColumn"
ItemStyle.HorizontalAlign="Right"
ItemStyle.Wrap="false"
ItemStyle.Font.Italic="false"
@@ -43,10 +46,11 @@ DataFormatString="$%.2f"
/>
<com:TCheckBoxColumn
+ ID="InStockColumn"
HeaderText="In-stock"
DataField="instock"
/>
- <com:TTemplateColumn HeaderText="Rating">
+ <com:TTemplateColumn ID="RatingColumn" HeaderText="Rating">
<prop:ItemTemplate>
<img src="images/star<%#$this->Parent->DataItem['rating']%>.gif" alt="" />
</prop:ItemTemplate>
@@ -70,6 +74,7 @@ ItemStyle.Font.Italic="false"
/>
<com:TButtonColumn
+ ID="DeleteColumn"
HeaderText="Delete"
HeaderStyle.Width="50px"
ItemStyle.HorizontalAlign="Center"
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample3.php b/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample3.php index 6d8c0085..69a164c6 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample3.php +++ b/demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample3.php @@ -138,13 +138,13 @@ class Sample3 extends TPage if($item->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;
|