summaryrefslogtreecommitdiff
path: root/demos/quickstart
diff options
context:
space:
mode:
authorxue <>2006-08-27 23:26:55 +0000
committerxue <>2006-08-27 23:26:55 +0000
commitc1937cccd0985e86e247287faa9ac60870feecd7 (patch)
tree95ec7083c7be815184c74cd8aa27d02a69d2ea77 /demos/quickstart
parent887da1b3668499821f046665b461aeadb0a9fb2e (diff)
Merge from 3.0 branch till 1350.
Diffstat (limited to 'demos/quickstart')
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TClientSideValidator/Home.page18
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample3.page7
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TDataGrid/Sample3.php16
-rw-r--r--demos/quickstart/protected/pages/Controls/Validation.page9
4 files changed, 28 insertions, 22 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;
diff --git a/demos/quickstart/protected/pages/Controls/Validation.page b/demos/quickstart/protected/pages/Controls/Validation.page
index 2241f346..119749db 100644
--- a/demos/quickstart/protected/pages/Controls/Validation.page
+++ b/demos/quickstart/protected/pages/Controls/Validation.page
@@ -160,7 +160,7 @@ The summary can be displayed as a list, a bulleted list, or a single paragraph b
<li>The <tt>OnError</tt> event is raised after the validator fails validation.</li>
</ul>
The corresponding events for the client side is available as sub-properties
- of the <tt>ClientSide</tt> property of the validator.
+ of the <tt>ClientSide</tt> property of the validator.
</p>
<p>The following example pop-up a message saying "hello" when the validator fails on the client-side.
<com:TTextHighlighter Language="prado" CssClass="source">
@@ -172,18 +172,19 @@ The summary can be displayed as a list, a bulleted list, or a single paragraph b
</com:TTextHighlighter>
The resulting client-side event callback function is of the following form.
<com:TTextHighlighter Language="javascript" CssClass="source">
-function onErrorHandler(validator, sender)
+function onErrorHandler(sender, parameter)
{
alert("hello");
}
</com:TTextHighlighter>
-Where <tt>validator</tt> is the current client-side validator and <tt>sender</tt>
+Where <tt>sender</tt> is the current client-side validator and <tt>parameter</tt>
is the control that invoked the validator.
</p>
<h3>Conditional Validation Example</h3>
<p>
The following example show the use of client-side and server side validator events. The example
-demonstrates conditional validation.
+demonstrates conditional validation.
<com:RunBar PagePath="Controls.Samples.TClientSideValidator.Home" />
</p>
+
</com:TContent> \ No newline at end of file