protected function getClientScriptOptions()
 {
     $options = parent::getClientScriptOptions();
     $accepts = preg_split("/\\s*,\\s* /", $this->getAcceptCssClass());
     $options['accept'] = TJavascript::toArray($accepts);
     $options['hoverclass'] = $this->getHoverCssClass();
     return $options;
 }
示例#2
0
 /**
  * Ensure that the ID attribute is rendered and registers the javascript code
  * for initializing the active control.
  */
 protected function addAttributesToRender($writer)
 {
     parent::addAttributesToRender($writer);
     $writer->addAttribute('id', $this->getClientID());
     $options = TJavascript::encode($this->getPostBackOptions());
     $cs = $this->getPage()->getClientScript();
     $code = "jQuery('#" . $this->getWidgetID() . "')." . $this->getWidget() . "(" . $options . ");";
     $cs->registerEndScript(sprintf('%08X', crc32($code)), $code);
 }
 /**
  * Renders marker only on callback process
  */
 public function render($writer)
 {
     if ($this->getPage()->getisCallback() || $this->getPage()->getIsPostBack()) {
         parent::render($writer);
     }
 }
示例#4
0
 /**
  * Overrides parent implementation. Callback {@link renderSortables()} when
  * page's IsCallback property is true.
  */
 public function dataBind()
 {
     parent::dataBind();
     if ($this->getPage()->getIsCallback()) {
         $this->renderSortables($this->getResponse()->createHtmlWriter());
     }
 }
示例#5
0
 /**
  * Overrides parent implementation to just render the inner contents and avoid replacing the element itself when
  * updating clientside, because replacing/removing will cause jqueryui to fire destroy on the original dialog extension.
  * @param THtmlWriter html writer
  */
 public function render($writer)
 {
     if ($this->getHasPreRendered() && $this->getActiveControl()->canUpdateClientSide()) {
         parent::renderContents($writer);
         $this->getPage()->getCallbackClient()->replaceContent($this, $writer, false);
     } else {
         parent::render($writer);
     }
 }
示例#6
0
 public function renderEndTag($writer)
 {
     parent::renderEndTag($writer);
     $script = "<script type=\"text/javascript\">/*<![CDATA[*/ var modal_" . $this->ClientID . " = new Modal.Box('" . $this->ClientID . "') /*]]>*/</script>";
     $writer->write($script);
 }