summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/ActiveControls/Samples
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2014-01-12 01:37:33 +0100
committerFabio Bas <ctrlaltca@gmail.com>2014-01-12 01:37:33 +0100
commit781f6731122cf622bcdf64441d247b5e37a2c3d0 (patch)
tree20413779800710ab61f2212f0972b207532b4f6a /demos/quickstart/protected/pages/ActiveControls/Samples
parent97869b581fc2af1724dbf07652533f7d2ded9371 (diff)
Added some TCallbackClientScript demos
Diffstat (limited to 'demos/quickstart/protected/pages/ActiveControls/Samples')
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page42
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php68
2 files changed, 105 insertions, 5 deletions
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page
index 539909a9..84521acb 100755
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page
@@ -7,12 +7,37 @@
</p>
<h2>Actions</h2>
-<com:TRadioButtonList ID="radio1">
+<com:TClientScript PradoScripts="jqueryui" />
+<com:TStyleSheet>
+ .red_background {
+ background-color: red;
+ }
+</com:TStyleSheet>
+
+<com:TRadioButtonList ID="radio1" RepeatColumns="2">
<com:TListItem Value="1" Text="alert() me of something" />
<com:TListItem Value="2" Text="toggle Checkbox 1" />
<com:TListItem Value="3" Text="hide Label 1" />
<com:TListItem Value="4" Text="show Label 1" />
- <com:TListItem Value="5" Text="focus TextBox 1" />
+ <com:TListItem Value="5" Text="toggle Label 1 visibility" />
+ <com:TListItem Value="6" Text="toggle Label 1 (fade)" />
+ <com:TListItem Value="7" Text="toggle Label 1 (slide)" />
+ <com:TListItem Value="8" Text="highlight Label 1 (requires jQuery UI)" />
+ <com:TListItem Value="9" Text="focus TextBox 1" />
+ <com:TListItem Value="10" Text="scroll to CheckBox 1" />
+ <com:TListItem Value="11" Text="add red_background class to TextBox 1" />
+ <com:TListItem Value="12" Text="remove red_background class from TextBox 1" />
+ <com:TListItem Value="13" Text="animated resize TextBox 1" />
+ <com:TListItem Value="14" Text="set the 'disable' attribute on TextBox 1" />
+ <com:TListItem Value="15" Text="change the background color of Panel 1" />
+ <com:TListItem Value="16" Text="prepend and append some content inside Panel 1" />
+ <com:TListItem Value="17" Text="prepend and append some content outside Panel 1" />
+ <com:TListItem Value="18" Text="replace Panel 1 with some plain text" />
+ <com:TListItem Value="19" Text="remove TextBox 1" />
+ <com:TListItem Value="20" Text="fade out TextBox 1" />
+ <com:TListItem Value="21" Text="fade in TextBox 1" />
+ <com:TListItem Value="22" Text="trigger a click event on Panel 1" />
+ <com:TListItem Value="23" Text="call a specific effect on TextBox 1 (toggle)" />
</com:TRadioButtonList>
<br/><com:TActiveButton ID="button1" OnCallback="buttonCallback" Text="callback!" />
@@ -32,8 +57,17 @@
<td>TextBox 1:</td>
<td><com:TTextBox ID="txt1" Text="Sample text" /></td>
</tr>
+ <tr>
+ <td>Panel 1:</td>
+ <td>
+ <com:TPanel ID="pan1" Style="width:100px;height:100px;background:green" Attributes.OnClick="alert('clicked on Panel1')" >
+ Panel contents
+ </com:TPanel>
+ </td>
+ </tr>
</table>
-<com:TJavascriptLogger />
-
+<div style="height:900px">
+Thw following space is intentionally left blank for the scrolling test
+</div>
</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php
index eeacb660..50a69911 100755
--- a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php
@@ -8,7 +8,7 @@ class Home extends TPage
switch($this->radio1->SelectedValue)
{
case 1:
- $this->getCallbackClient()->evaluateScript("<script> alert('something'); </script>");
+ $this->getCallbackClient()->evaluateScript("alert('something');");
break;
case 2:
$this->getCallbackClient()->check($this->check1, !$this->check1->Checked);
@@ -20,8 +20,74 @@ class Home extends TPage
$this->getCallbackClient()->show($this->label1);
break;
case 5:
+ $this->getCallbackClient()->toggle($this->label1);
+ break;
+ case 6:
+ $this->getCallbackClient()->toggle($this->label1, 'fade');
+ break;
+ case 7:
+ $this->getCallbackClient()->toggle($this->label1, 'slide');
+ break;
+ case 8:
+ $this->getCallbackClient()->highlight($this->label1);
+ break;
+ case 9:
$this->getCallbackClient()->focus($this->txt1);
break;
+ case 10:
+ $this->getCallbackClient()->scrollTo($this->check1, array('duration' => 1000, 'offset' => 10));
+ break;
+ case 11:
+ $this->getCallbackClient()->addCssClass($this->txt1, 'red_background');
+ break;
+ case 12:
+ $this->getCallbackClient()->removeCssClass($this->txt1, 'red_background');
+ break;
+ case 13:
+ $this->getCallbackClient()->jQuery($this->txt1, 'animate', array(
+ array( 'width' => '+=100',
+ 'height' => '+=50'
+ ),
+ array(
+ 'duration' => 1000,
+ )
+ ));
+ break;
+ case 14:
+ $this->getCallbackClient()->setAttribute($this->txt1, 'disabled', true);
+ break;
+ case 15:
+ $this->getCallbackClient()->setStyle($this->pan1, array('background-color' => 'blue'));
+ break;
+ case 16:
+ $this->getCallbackClient()->prependContent($this->pan1, 'prepend<br/>');
+ $this->getCallbackClient()->appendContent($this->pan1, '<br/>append');
+ break;
+ case 17:
+ $this->getCallbackClient()->insertContentBefore($this->pan1, 'before');
+ $this->getCallbackClient()->insertContentAfter($this->pan1, 'after');
+ break;
+ case 18:
+ $this->getCallbackClient()->replaceContent($this->pan1, 'No more Panel 1');
+ break;
+ case 19:
+ $this->getCallbackClient()->remove($this->txt1);
+ break;
+ case 20:
+ $this->getCallbackClient()->fadeOut($this->txt1);
+ break;
+ case 21:
+ $this->getCallbackClient()->fadeIn($this->txt1);
+ break;
+ case 22:
+ $this->getCallbackClient()->click($this->pan1);
+ // alternative
+ // $this->getCallbackClient()->raiseClientEvent($this->pan1, 'click');
+ break;
+ case 23:
+ $this->getCallbackClient()->jQuery($this->txt1, 'toggle');
+ break;
+
}
}
}