From 7aa665260609bcca0af2af6f0eceb80dec077033 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sat, 23 Aug 2014 12:24:44 +0200 Subject: Added some TCallbackClientScript demos cherry-picked from 781f6731122cf622bcdf64441d247b5e37a2c3d0 --- .../protected/pages/ActiveControls/Home.page | 2 +- .../Samples/TCallbackClientScript/Home.page | 35 ++++++++++++++++--- .../Samples/TCallbackClientScript/Home.php | 39 +++++++++++++++++++--- 3 files changed, 66 insertions(+), 10 deletions(-) (limited to 'demos/quickstart') diff --git a/demos/quickstart/protected/pages/ActiveControls/Home.page b/demos/quickstart/protected/pages/ActiveControls/Home.page index 9586f421..92bdbca2 100755 --- a/demos/quickstart/protected/pages/ActiveControls/Home.page +++ b/demos/quickstart/protected/pages/ActiveControls/Home.page @@ -6,7 +6,7 @@ Most active controls have a property of ActiveControl and a sub-property ClientSide that provides many properties to customize the controls. The -CallbackClient property of the +CallbackClient property of the TPage class provides many methods to update and alter the client-side content during a callback request. Active controls is reliant on a collection of javascript classes. diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page index 539909a9..dfec4755 100755 --- a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.page @@ -7,12 +7,28 @@

Actions

- - + + + .red_background { + background-color: red; + } + + + - + + + + + + + + + + +
@@ -32,8 +48,17 @@ TextBox 1: + + Panel 1: + + + Panel contents + + + - - +
+Thw following space is intentionally left blank for the scrolling test +
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php index eeacb660..4cd655ef 100755 --- a/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackClientScript/Home.php @@ -7,9 +7,6 @@ class Home extends TPage { switch($this->radio1->SelectedValue) { - case 1: - $this->getCallbackClient()->evaluateScript(""); - break; case 2: $this->getCallbackClient()->check($this->check1, !$this->check1->Checked); break; @@ -19,9 +16,43 @@ class Home extends TPage case 4: $this->getCallbackClient()->show($this->label1); break; - case 5: + 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 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
'); + $this->getCallbackClient()->appendContent($this->pan1, '
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 22: + $this->getCallbackClient()->click($this->pan1); + // alternative + // $this->getCallbackClient()->raiseClientEvent($this->pan1, 'click'); + break; } } } -- cgit v1.2.3