QControlBase::RenderAjax PHP Method

RenderAjax() public method

public RenderAjax ( $blnDisplayOutput = true )
    public function RenderAjax($blnDisplayOutput = true)
    {
        // Only render if this control has been modified at all
        if ($this->blnModified) {
            // Render if (1) object has no parent or (2) parent was not rendered nor currently being rendered
            if (!$this->objParentControl || !$this->objParentControl->Rendered && !$this->objParentControl->Rendering) {
                $strRenderMethod = $this->strRenderMethod;
                if ($strRenderMethod) {
                    return $this->{$strRenderMethod}($blnDisplayOutput);
                }
            }
        }
    }

Usage Example

 /**
  * Renders the AjaxHelper for the QForm
  * @param QControlBase $objControl
  *
  * @return string The Ajax helper string (should be JS commands)
  */
 protected function RenderAjaxHelper($objControl)
 {
     $controls = [];
     if ($objControl) {
         $controls = array_merge($controls, $objControl->RenderAjax());
         // will return an array of controls to be merged with current controls
         foreach ($objControl->GetChildControls() as $objChildControl) {
             $controls = array_merge($controls, $this->RenderAjaxHelper($objChildControl));
         }
     }
     return $controls;
 }
All Usage Examples Of QControlBase::RenderAjax