Invoked before the menu is rendered.

@method preRender
511114
function () {
        var self = this;

        self.items().each(function (ctrl) {
          var settings = ctrl.settings;

          if (settings.icon || settings.image || settings.selectable) {
            self._hasIcons = true;
            return false;
          }
        });

        if (self.settings.itemsFactory) {
          self.on('postrender', function () {
            if (self.settings.itemsFactory) {
              self.load();
            }
          });
        }

        return self._super();
      }
425617
protected void beforeStartElement() {
        beforeMarkup();
        if (stack.length <= depth + 1) {
            // Allocate more space for the stack:
            int[] newStack = new int[stack.length * 2];
            System.arraycopy(stack, 0, newStack, 0, stack.length);
            stack = newStack;
        }
        stack[depth + 1] = 0; // nothing written yet
    }
337926
public function beforeDisplay()
    {
        if ($this->_csrf) {
            $this->_csrf->initCsrfToken();
        }

        $links = $this->getMenuList();
        if (\MUtil_Bootstrap::enabled()) {
            if ($links) {
                $element = $this->_form->createElement('html', 'menuLinks');
                $element->setValue($links);
                $element->setOrder(999);
                $this->_form->addElement($element);
            }
        } else {
            $table = new \MUtil_Html_TableElement(array('class' => $this->class));
            $table->setAsFormLayout($this->_form, true, true);

            // There is only one row with formLayout, so all in output fields get class.
            $table['tbody'][0][0]->appendAttrib('class', $this->labelClass);

            if ($links) {
                $table->tf(); // Add empty cell, no label
                $table->tf($links);
            }
        }
    }
137529
public function onBeforeInit()
    {
        $canEdit        = FrontendEditing::ShowAdmin();
        $editingEnabled = FrontendEditing::editingEnabled();
        $minExt         = (Director::isDev()) ? "" : ".min";

        if ($canEdit) {
            // Enable front-end fly-out menu
            // 
            //Flexslider imports easing, which breaks?
            Requirements::block('flexslider/javascript/jquery.easing.1.3.js');

            Requirements::javascript(FRAMEWORK_DIR.'/thirdparty/jquery/jquery.js');
            Requirements::javascript(FRAMEWORK_DIR.'/thirdparty/jquery-ui/jquery-ui.js');
            Requirements::javascript(FRAMEWORK_ADMIN_DIR.'/javascript/ssui.core.js');
            Requirements::javascript(THIRDPARTY_DIR.'/jquery-entwine/dist/jquery.entwine-dist.js');
            Requirements::javascriptTemplate(FRONTEND_ADMIN_DIR.'/javascript/dist/FrontEndAdminTemplate'.$minExt.'.js', $this->getConfig($this->owner->data()));
            Requirements::css(FRAMEWORK_DIR.'/thirdparty/jquery-ui-themes/smoothness/jquery-ui.css');
            Requirements::javascript(FRONTEND_ADMIN_DIR.'/javascript/dist/FrontEndAdmin'.$minExt.'.js');
            Requirements::css(FRONTEND_ADMIN_DIR.'/css/frontend-admin'.$minExt.'.css');

            $this->owner->getResponse()->addHeader("X-DynamicCache-OptOut", true);
        }
        if ($canEdit && $editingEnabled) {
            // Disable mode pagespeed while editing
            $this->owner->getResponse()->addHeader("PageSpeed", "off");
            // Disable HTTP cache while editing
            HTTP::set_cache_age(0);
            // Enable TinyMCE when editing has been enabled
            Requirements::javascript(FRONTEND_ADMIN_DIR.'/bower_components/tinymce/jquery.tinymce.min.js');
            Requirements::javascript(FRONTEND_ADMIN_DIR.'/javascript/dist/FrontEndEditor'.$minExt.'.js');
            Requirements::css(FRONTEND_ADMIN_DIR.'/css/frontend-editor'.$minExt.'.css');
        }
    }
442371
function Menu() {
  ui.Emitter.call(this);
  this.items = {};
  this.el = $(html).hide().appendTo('body');
  this.el.hover(this.deselect.bind(this));
  $('html').click(this.hide.bind(this));
  this.on('show', this.bindKeyboardEvents.bind(this));
  this.on('hide', this.unbindKeyboardEvents.bind(this));
}
479030
function(options) {
            this.options = options;
            this.init(options);
            this.render = Augmented.Utility.wrap(this.render, function(render) {
              this.beforeRender();
              render.apply(this);
              this.afterRender();
              return this;
            });
          }
129510
function showMenu() {
        var self = this, menu = self.get('menu');    // does not put this into setter
                                                     // in case set menu before submenu item is  rendered
        // does not put this into setter
        // in case set menu before submenu item is  rendered
        var align = {
                node: this.$el,
                points: [
                    'tr',
                    'tl'
                ],
                overflow: {
                    adjustX: 1,
                    adjustY: 1
                }
            };
        util.mix(menu.get('align'), align, false);
        menu.show();
        self.el.setAttribute('aria-haspopup', menu.get('el').attr('id'));
    }
375770
def beforeRender(self, ctx):
        
        request = IRequest(ctx)
        root = self.webSite.rootURL(request)
        self._moduleRoot = root.child('__jsmodule__')
899712
def before_render(self):
        
        super(PricelistsView, self).before_render()
        # Render the Add button if the user has the AddPricelist permission
        if check_permission(AddPricelist, self.context):
            self.context_actions[_("Add")] = {
                "url": "createObject?type_name=Pricelist",
                "icon": "++resource++bika.lims.images/add.png"
            }
        # Don't allow any context actions on the Methods folder
        self.request.set("disable_border", 1)
349702
protected function initRendering()
    {
        $paramColumn = $this->getTable()->getParamAdapter()->getColumn();
        $paramOrder = $this->getTable()->getParamAdapter()->getOrder();
        $order = ($paramColumn == $this->getName()) ? self::$orderReverse[$paramOrder] : 'asc';

        if ($this->getSortable()) {
            $classSorting = ($paramColumn == $this->getName())
                ? 'sorting_' . self::$orderReverse[$paramOrder] : 'sorting';
            $this->addClass($classSorting);
            $this->addClass('sortable');
            $this->addAttr('data-order', $order);
            $this->addAttr('data-column', $this->getName());
        }


        if ($this->width) {
            $this->addAttr('width', $this->width);
        }
    }
9679
function renderPrev($tag = '&lt;&lt;') {
        if ($this->total_rows == 0)
            return FALSE;
         
        if ($this->page > 1) {
            //return ' <a href="' . $this->php_self . '?page=' . ($this->page - 1) . '&' . $this->append . '">' . $tag . '</a>';
            $pageno = $this->page - 1;
            return " <a href='javascript:void(0);' OnClick='getdata( $pageno )' title='Anterior'>$tag</a> ";
        } else {
            return " $tag ";
        }
    }
259278
protected function prepareForPresentation()
    {
        if ($this->prepared) {
            return;
        }

        if ($this->isMenuCached()) {
            list($layout, $permissionsIndex) = $this->retrieveMenuFromCache();
        } else {
            list($layout, $permissionsIndex) = $this->interpretMenuData();
        }

        if ( ! $this->ignorePermission && ! $this->auth->admin()) {
            $layout = $this->permissionsFilter->filterLayout($layout, $this->auth->user(), $permissionsIndex);
        }

        $this->menuLayout           = new Collection($layout->layout());
        $this->alternativePresences = new Collection($layout->alternative());

        $this->prepared = true;
    }
717032
public function Render()
    {
        if (strlen($this->_ankor) > 0) {
            WebApplication::$app->getResponse()->addJavaScript("window.location='#" . $this->_ankor . "'", true);
            $this->_ankor = '';
        }
        $this->beforeRender();
        $this->RenderImpl();
        $this->afterRender();
    }
383519
function render() {
      var checked = rgCtrl.getViewValue() == attr.value;

      if (checked === lastChecked) return;

      if (element[0].parentNode.nodeName.toLowerCase() !== 'md-radio-group') {
        // If the radioButton is inside a div, then add class so highlighting will work
        element.parent().toggleClass(CHECKED_CSS, checked);
      }

      if (checked) {
        rgCtrl.setActiveDescendant(element.attr('id'));
      }

      lastChecked = checked;

      element
        .attr('aria-checked', checked)
        .toggleClass(CHECKED_CSS, checked);
    }
633663
public function beforeRenderSiteTitle()
    {
        $controller = $this->_controller();

        $controller->set('siteTitle', $this->_getSiteTitle());
        $controller->set('siteTitleLink', $this->_getSiteTitleLink());
        $controller->set('siteTitleImage', $this->_getSiteTitleImage());
    }
922430
public function beforeRender(Event $event)
    {
        parent::beforeRender($event);

        $this->set('detect', $this->detect);
    }
945494
function waitForRender() {
            var deferredRender = $q.defer();
            function wait() {
              if ($element.find("table:visible").length === 0) {
                $timeout(wait, 100);
              } else {
                deferredRender.resolve();
              }
            }

            $timeout(wait);
            return deferredRender.promise;
          }