The TCallback provides a basic callback handler that can be invoked from the client side by running the javascript code obtained from the {@link TBaseActiveCallbackControl::getJavascript ActiveControl.Javascript} property. The event {@link onCallback OnCallback} is raised when a callback is requested made. Example usage:
Click Me!
Since: 3.1
Inheritance: extends Prado\Web\UI\TControl, implements Prado\Web\UI\ActiveControls\ICallbackEventHandler, implements Prado\Web\UI\ActiveControls\IActiveControl
コード例 #1
0
 /**
  * Registers the javascript code for initializing the active control.
  * @param THtmlWriter the renderer.
  */
 public function render($writer)
 {
     parent::render($writer);
     $this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getTriggerOptions());
     if ($this->getStartTimerOnLoad()) {
         $id = $this->getClientID();
         $code = "Prado.WebUI.TTimeTriggeredCallback.start('{$id}');";
         $cs = $this->getPage()->getClientScript();
         $cs->registerEndScript("{$id}:start", $code);
     }
 }