Render the dialog (+link) to show/hide columns
184044
function() {
      this.tableOptions = inputEx.cn('a', {href: '#'}, null, msgs.tableOptions);
      this.options.parentEl.appendChild(this.tableOptions);
      
      this.tableOptionsDlg = new YAHOO.widget.SimpleDialog( Dom.generateId(), {
              width: "30em",
		        visible: false,
		        modal: true,
		        buttons: [ 
				      { text:msgs.columnDialogCloseButton,  handler: function(e) { this.hide(); } }
              ],
              fixedcenter: true,
              constrainToViewport: true
	   });
	
		Dom.addClass(this.tableOptionsDlg.element.firstChild, "inputex-datatable-columnsDlg");
		
	   this.tableOptionsDlg.bodyId = Dom.generateId();
	   this.tableOptionsDlg.setHeader(msgs.columnDialogTitle);
	   this.tableOptionsDlg.setBody("<div id='"+this.tableOptionsDlg.bodyId+"'></div>");
	   this.tableOptionsDlg.render(document.body);
   }
130956
function() {
        var editor = this;
        $.map(this.toolbar.commandMapping, function(value) {
          return [value];
        }).filter(function(commandObj) {
          return commandObj.dialog;
        }).map(function(commandObj) {
          return commandObj.dialog;
        }).forEach(function(dialog) {
          dialog.on('show', function() {
            $(this.container).modal('show');
          });
          dialog.on('hide', function() {
            $(this.container).modal('hide');
            setTimeout(editor.composer.focus, 0);
          });
          $(dialog.container).on('shown.bs.modal', function () {
            $(this).find('input, select, textarea').first().focus();
          });
        });
        this.on('change_view', function() {
          $(this.toolbar.container.children).find('a.btn').not('[data-wysihtml5-action="change_view"]').toggleClass('disabled');
        });
      }
411283
function () {

		// make sure the listener for checkpanels is set-up
		Dispatcher.addListener('insertPanels', modalViewer.insert);

		// add the info/code panel onclick handler
		$('.pl-js-pattern-info-toggle').click(function (e) {
			modalViewer.toggle();
		});

		// make sure the close button handles the click
		$('.pl-js-modal-close-btn').on('click', function (e) {

			// hide any open annotations
			obj = JSON.stringify({
				'event': 'patternLab.annotationsHighlightHide'
			});
			document.querySelector('.pl-js-iframe').contentWindow.postMessage(obj, modalViewer.targetOrigin);

			// hide the viewer
			modalViewer.close();

		});

		// see if the modal is already active, if so update attributes as appropriate
		if (DataSaver.findValue('modalActive') === 'true') {
			modalViewer.active = true;
			$('.pl-js-pattern-info-toggle').html("Hide Pattern Info");
		}

		// make sure the modal viewer is not viewable, it's always hidden by default. the pageLoad event determines when it actually opens
		modalViewer.hide();

		// review the query strings in case there is something the modal viewer is supposed to handle by default
		var queryStringVars = urlHandler.getRequestVars();

		// show the modal if code view is called via query string
		if ((queryStringVars.view !== undefined) && ((queryStringVars.view === 'code') || (queryStringVars.view === 'c'))) {
			modalViewer.queryPattern();
		}

		// show the modal if the old annotations view is called via query string
		if ((queryStringVars.view !== undefined) && ((queryStringVars.view === 'annotations') || (queryStringVars.view === 'a'))) {
			modalViewer.queryPattern();
		}

	}
955128
function render(Frame $frame, $stacking = false) {
    global $_dompdf_debug;

    if ( $_dompdf_debug ) {
      echo $frame;
      flush();
    }
    
    $style = $frame->get_style();
    
    if ( in_array($style->visibility, array("hidden", "collapse")) ) {
      return;
    }

    $render_self = self::$stacking_first_pass && !$stacking || !self::$stacking_first_pass;
    
    if ( $render_self ) {
      $display = $style->display;
      
      // Starts the CSS transformation
      if ( $style->transform && is_array($style->transform) ) {
        $this->_canvas->save();
        list($x, $y, $w, $h) = $frame->get_padding_box();
        $origin = $style->transform_origin;
        
        foreach($style->transform as $transform) {
          list($function, $values) = $transform;
          if ( $function === "matrix" ) {
            $function = "transform";
          }
          
          $values = array_map("floatval", $values);
          $values[] = $x + $style->length_in_pt($origin[0], $style->width);
          $values[] = $y + $style->length_in_pt($origin[1], $style->height);
          
          call_user_func_array(array($this->_canvas, $function), $values);
        }
      }
    
      switch ($display) {
        
      case "block":
      case "list-item":
      case "inline-block":
      case "table":
      case "inline-table":
        $this->_render_frame("block", $frame);
        break;
  
      case "inline":
        if ( $frame->is_text_node() )
          $this->_render_frame("text", $frame);
        else
          $this->_render_frame("inline", $frame);
        break;
  
      case "table-cell":
        $this->_render_frame("table-cell", $frame);
        break;
  
      case "table-row-group":
      case "table-header-group":
      case "table-footer-group":
        $this->_render_frame("table-row-group", $frame);
        break;
  
      case "-dompdf-list-bullet":
        $this->_render_frame("list-bullet", $frame);
        break;
  
      case "-dompdf-image":
        $this->_render_frame("image", $frame);
        break;
        
      case "none":
        $node = $frame->get_node();
            
        if ( $node->nodeName === "script" ) {
          if ( $node->getAttribute("type") === "text/php" ||
               $node->getAttribute("language") === "php" ) {
            // Evaluate embedded php scripts
            $this->_render_frame("php", $frame);
          }
          
          elseif ( $node->getAttribute("type") === "text/javascript" ||
               $node->getAttribute("language") === "javascript" ) {
            // Insert JavaScript
            $this->_render_frame("javascript", $frame);
          }
        }
  
        // Don't render children, so skip to next iter
        return;
        
      default:
        break;
  
      }
  
      // Check for begin frame callback
      $this->_check_callbacks("begin_frame", $frame);
      
      // Starts the overflow: hidden box
      if ( $style->overflow === "hidden" ) {
        list($x, $y, $w, $h) = $frame->get_padding_box();
        $this->_canvas->clipping_rectangle($x, $y, $w, $h);
      }
    }
  
    $page = $frame->get_root()->get_reflower();
    
    foreach ($frame->get_children() as $child) {
      $child_style = $child->get_style();
      $_stacking = $stacking;
      
      // Stacking context
      if ( self::$stacking_first_pass && (
           $child_style->z_index !== "auto" || 
           $child_style->float !== "none" || 
           $child->is_positionned()) ) {
        $z_index = ($child_style->z_index === "auto") ? 0 : intval($child_style->z_index);
        $page->add_frame_to_stacking_context($child, $z_index);
        $_stacking = true;
      }
      
      $this->render($child, $_stacking);
    }
     
    if ( $render_self ) {
      // Ends the overflow: hidden box
      if ( $style->overflow === "hidden" ) {
        $this->_canvas->clipping_end();
      }
  
      if ( $style->transform && is_array($style->transform) ) {
        $this->_canvas->restore();
      }
  
      // Check for end frame callback
      $this->_check_callbacks("end_frame", $frame);
    }
  }
1010157
public void show() {
        if (!(container instanceof RootPanel)) {
            if (!(container instanceof MaterialDialog)) {
                container.getElement().getStyle().setPosition(Style.Position.RELATIVE);
            }
            div.getElement().getStyle().setPosition(Style.Position.ABSOLUTE);
        }
        if (scrollDisabled) {
            RootPanel.get().getElement().getStyle().setOverflow(Style.Overflow.HIDDEN);
        }
        if (type == LoaderType.CIRCULAR) {
            div.setStyleName(CssName.VALIGN_WRAPPER + " " + CssName.LOADER_WRAPPER);
            div.add(preLoader);
        } else if (type == LoaderType.PROGRESS) {
            div.setStyleName(CssName.VALIGN_WRAPPER + " " + CssName.PROGRESS_WRAPPER);
            progress.getElement().getStyle().setProperty("margin", "auto");
            div.add(progress);
        }
        container.add(div);
    }
1136273
public function render()
    {
        if ($this->config[ 'ordering' ]) {
            $this->attributes->addAttributeClass('table-ordering');
        }

        // Render header
        $tr = $this->header->createRow();

        foreach ($this->columns as $key => $column) {

            $th = $tr->createColumn('th');

            $column[ 'attr' ][ 'data-column' ] = $key;

            foreach ($column[ 'attr' ] as $name => $value) {
                if ( ! empty($value)) {
                    $th->attributes->addAttribute($name, $value);
                }
            }

            if ($column[ 'sorting' ] === true) {
                $icon = new Ui\Contents\Icon('fa fa-sort');
                $icon->attributes->addAttributeClass(['text-muted', 'float-right', 'mt-1']);

                $th->attributes->addAttributeClass('col-sortable');
                $th->attributes->addAttribute('data-toggle', 'sort');
                $th->childNodes->push($icon);
            }

            if ($column[ 'show' ] === false) {
                $th->attributes->addAttributeClass('hidden');
            }

            $th->textContent->push(language()->getLine($column[ 'label' ]));
        }

        // Render tbody
        if ($this->rows->count() > 0) {
            $totalEntries = $this->rows->count();
            $totalRows = $this->rows->countAll();
            $currentPage = input()->get('page') ? input()->get('page') : 1;
            $startNumber = $currentPage == 1 ? 1 : $currentPage * $this->config[ 'entries' ][ 'minimum' ];
            $totalPages = round($totalRows / $this->config[ 'entries' ][ 'minimum' ]);
            $totalPages = $totalPages == 0 && $totalRows > 0 ? 1 : $totalPages;

            $i = $startNumber;
            foreach ($this->rows as $row) {
                $row->numbering = $i;
                $tr = $this->body->createRow();
                $tr->attributes->addAttribute('data-id', $row->id);

                foreach ($this->columns as $key => $column) {

                    $column[ 'key' ] = $key;
                    $td = $tr->createColumn();

                    $column[ 'attr' ][ 'data-column' ] = $key;

                    foreach ($column[ 'attr' ] as $name => $value) {
                        if ( ! empty($value)) {
                            $td->attributes->addAttribute($name, $value);
                        }
                    }

                    if ($column[ 'show' ] === false) {
                        $td->attributes->addAttributeClass('hidden');
                    }

                    $td->attributes->addAttributeClass('col-body-' . $key);

                    $this->renderBodyColumn($td, $column, $row);
                }

                $i++;
            }
        } else {
            $totalEntries = 0;
            $totalRows = 0;
            $currentPage = 1;
            $startNumber = 0;
            $totalPages = 0;
        }

        $showEntries = input()->get('entries') ? input()->get('entries') : $this->config[ 'entries' ][ 'minimum' ];

        // Build table card
        $card = new Ui\Components\Card();
        $card->attributes->addAttribute('data-role', 'table-crud');
        $card->attributes->addAttributeClass('card-table');

        // Build table header tools
        $tools = new Element('div', 'cardHeaderTools');
        $tools->attributes->addAttributeClass(['card-tools', 'float-left']);

        $buttons = new Ui\Components\Buttons\Group();
        foreach ($this->tools as $key => $tool) {
            if ($tool[ 'show' ] === false) {
                continue;
            }

            if ($tool[ 'label' ] === true) {
                $button = $buttons->createButton(language()->getLine('TABLE_BUTTON_' . strtoupper($key)));
                if ( ! empty($tool[ 'icon' ])) {
                    $button->setIcon($tool[ 'icon' ]);
                }
            } else {
                $button = $buttons->createButton(new Ui\Contents\Icon($tool[ 'icon' ]));
                $button->attributes->addAttribute('data-toggle', 'tooltip');
                $button->attributes->addAttribute('title',
                    language()->getLine('TABLE_BUTTON_' . strtoupper($key)));
            }

            if ( ! empty($tool[ 'href' ])) {
                $tool[ 'data-url' ] = $tool[ 'href' ];
            }

            if (isset($tool[ 'attr' ])) {
                foreach ($tool[ 'attr' ] as $name => $value) {
                    $button->attributes->addAttribute($name, $value);
                }
            }

            $button->setContextualClass($tool[ 'contextual' ]);
            $button->smallSize();
            $button->attributes->addAttribute('data-action', $key);
        }

        $tools->childNodes->push($buttons);

        $card->header->childNodes->push($tools);

        // Build table header options
        $options = new Element('div', 'cardHeaderOptions');
        $options->attributes->addAttributeClass(['card-options', 'float-right']);

        $buttons = new Ui\Components\Buttons\Group();
        foreach ($this->options as $key => $option) {
            if ($option[ 'show' ] === false) {
                continue;
            }

            if ($option[ 'label' ] === true) {
                $button = $buttons->createButton(language()->getLine('TABLE_BUTTON_' . strtoupper($key)));
                if ( ! empty($option[ 'icon' ])) {
                    $button->setIcon($option[ 'icon' ]);
                }
            } else {
                $button = $buttons->createButton(new Ui\Contents\Icon($option[ 'icon' ]));
                $button->attributes->addAttribute('data-toggle', 'tooltip');
                $button->attributes->addAttribute('title',
                    language()->getLine('TABLE_BUTTON_' . strtoupper($key)));
            }

            if ( ! empty($option[ 'href' ])) {
                $option[ 'data-url' ] = $option[ 'href' ];
            }

            if (isset($option[ 'attr' ])) {
                foreach ($option[ 'attr' ] as $name => $value) {
                    $button->attributes->addAttribute($name, $value);
                }
            }

            $button->setContextualClass($option[ 'contextual' ]);
            $button->smallSize();
            $button->attributes->addAttribute('data-action', $key);
        }

        $options->childNodes->push($buttons);

        $card->header->childNodes->push($options);

        // Build table body
        $cardBody = $card->createBody();
        $cardBodyRow = $cardBody->createRow();

        $columnSearch = $cardBodyRow->createColumn(['class' => 'col-md-4']);
        $columnShow = $cardBodyRow->createColumn(['class' => 'col-md-8']);

        // Search
        $search = new Ui\Components\Form\Elements\Input([
            'name'        => 'query',
            'data-role'   => 'table-crud-search',
            'placeholder' => language()->getLine('TABLE_LABEL_SEARCH'),
            'value'       => input()->get('query'),
        ]);

        $columnSearch->childNodes->push($search);

        // Show
        $inputGroup = new Ui\Components\Form\Input\Group();

        $addOn = new Ui\Components\Form\Input\Group\AddOn();
        $addOn->textContent->push(language()->getLine('TABLE_LABEL_SHOW'));

        $inputGroup->childNodes->push($addOn);

        $options = [];
        foreach (range((int)$this->config[ 'entries' ][ 'minimum' ], (int)$this->config[ 'entries' ][ 'maximum' ],
            (int)$this->config[ 'entries' ][ 'step' ]) as $entries
        ) {
            $options[ $entries ] = $entries;
        }

        $columnsDropdown = new Ui\Components\Dropdown(language()->getLine('TABLE_LABEL_COLUMNS'));
        $columnsDropdown->attributes->addAttribute('data-role', 'table-crud-columns');

        foreach ($this->columns as $key => $column) {

            if ($column[ 'hiding' ] === false) {
                continue;
            }

            $label = new Ui\Components\Form\Elements\Label();
            $label->attributes->addAttributeClass('form-check-label');
            $label->textContent->push(language()->getLine($column[ 'label' ]));

            $checkbox = new Ui\Components\Form\Elements\Input([
                'type'        => 'checkbox',
                'class'       => 'form-check-input',
                'data-toggle' => 'table-crud-columns',
                'data-column' => $key,
            ]);

            $checkbox->attributes->removeAttributeClass('form-control');

            if ($column[ 'show' ] === true) {
                $checkbox->attributes->addAttribute('checked', 'checked');
            }

            $label->childNodes->push($checkbox);

            $columnsDropdown->menu->createItem($label);
        }

        $inputGroup->childNodes->push($columnsDropdown);

        $select = new Ui\Components\Form\Elements\Select();
        $select->attributes->addAttribute('name', 'entries');
        $select->createOptions($options, $showEntries);
        $inputGroup->childNodes->push($select);

        $addOn = new Ui\Components\Form\Input\Group\AddOn();
        $addOn->textContent->push(language()->getLine('TABLE_LABEL_PAGE', [
            $startNumber,
            $totalEntries,
            $totalRows,
            $currentPage,
            $totalPages,
        ]));

        $inputGroup->childNodes->push($addOn);

        $input = new Ui\Components\Form\Elements\Input([
            'name'        => 'page',
            'placeholder' => language()->getLine('TABLE_LABEL_GOTO'),
        ]);

        $inputGroup->childNodes->push($input);

        $pagination = new Ui\Components\Pagination($totalRows, $showEntries);
        $inputGroup->childNodes->push($pagination);

        $columnShow->childNodes->push($inputGroup);

        $card->textContent->push(parent::render());

        return $card->render();
    }
835794
public function renderTableHeader()
	{
		if(!$this->hideHeader)
		{
			echo "<thead>\n";

			if($this->filterPosition===self::FILTER_POS_HEADER)
				$this->renderFilter();

			echo "<tr>\n";
			foreach($this->columns as $column)
				$column->renderHeaderCell();
			echo "</tr>\n";

			if($this->filterPosition===self::FILTER_POS_BODY)
				$this->renderFilter();

			echo "</thead>\n";
		}
		elseif($this->filter!==null && ($this->filterPosition===self::FILTER_POS_HEADER || $this->filterPosition===self::FILTER_POS_BODY))
		{
			echo "<thead>\n";
			$this->renderFilter();
			echo "</thead>\n";
		}
	}
1322796
def render(self):
        """"""
        return FRAME_HTML % {
            'id': self.id,
            'filename': escape(self.filename),
            'lineno': self.lineno,
            'function_name': escape(self.function_name),
            'current_line': escape(self.current_line.strip())
        }
1253587
function() {
			var el = this.parts.dialog;
			var dialogSize = this.getSize();
			var win = CKEDITOR.document.getWindow(),
					viewSize = win.getViewPaneSize();

			var posX = ( viewSize.width - dialogSize.width ) / 2,
				posY = ( viewSize.height - dialogSize.height ) / 2;

			// Switch to absolute position when viewport is smaller than dialog size.
			if ( !CKEDITOR.env.ie6Compat ) {
				if ( dialogSize.height + ( posY > 0 ? posY : 0 ) > viewSize.height ||
						 dialogSize.width + ( posX > 0 ? posX : 0 ) > viewSize.width )
					el.setStyle( 'position', 'absolute' );
				else
					el.setStyle( 'position', 'fixed' );
			}

			this.move( this._.moved ? this._.position.x : posX,
					this._.moved ? this._.position.y : posY );
		}
473180
private void paintColumnHeading(final WTableColumn col, final boolean sortable,
			final WebXmlRenderContext renderContext) {
		XmlStringBuilder xml = renderContext.getWriter();
		int width = col.getWidth();
		Alignment align = col.getAlign();

		xml.appendTagOpen("ui:th");
		xml.appendOptionalAttribute("width", width > 0, width);
		xml.appendOptionalAttribute("sortable", sortable, "true");

		if (Alignment.RIGHT.equals(align)) {
			xml.appendAttribute("align", "right");
		} else if (Alignment.CENTER.equals(align)) {
			xml.appendAttribute("align", "center");
		}

		xml.appendClose();

		col.paint(renderContext);

		xml.appendEndTag("ui:th");
	}
935785
function onLinksDone(loaded) {
                                if (loaded === 2) {
                                    if (hasLayoutChanged) {
                                        $target.find('[lazo-cmp-name]').remove();
                                        $target.append(html);
                                    } else {
                                        $target.html(html);
                                    }
                                    setTimeout(function () {
                                        LAZO.error.clear();
                                        $target.css({ 'visibility': 'visible'} );
                                        viewManager.attachViews(ctl, function (err, success) {
                                            if (err) {
                                                LAZO.logger.error('[LAZO.navigate] Error attaching views', err);
                                            }

                                            doc.updatePageTags(LAZO.ctl.ctx, function (err) {
                                                if (err) {
                                                    LAZO.logger.error('[LAZO.navigate] Error updating page tags', err);
                                                }

                                                doc.setTitle(LAZO.ctl.ctx._rootCtx.pageTitle);
                                                LAZO.app.trigger('navigate:application:complete', eventData);
                                            });
                                        });
                                    }, 0);
                                }
                            }
308033
function ()
	{
		var dt = this.s.dt;
		var width = $(window).width();
		var breakpoints = this.c.breakpoints;
		var breakpoint = breakpoints[0].name;
		var columns = this.s.columns;
		var i, ien;

		// Determine what breakpoint we are currently at
		for ( i=breakpoints.length-1 ; i>=0 ; i-- ) {
			if ( width <= breakpoints[i].width ) {
				breakpoint = breakpoints[i].name;
				break;
			}
		}
		
		// Show the columns for that break point
		var columnsVis = this._columnsVisiblity( breakpoint );

		// Set the class before the column visibility is changed so event
		// listeners know what the state is. Need to determine if there are
		// any columns that are not visible but can be shown
		var collapsedClass = false;
		for ( i=0, ien=columns.length ; i<ien ; i++ ) {
			if ( columnsVis[i] === false && ! columns[i].never ) {
				collapsedClass = true;
				break;
			}
		}

		$( dt.table().node() ).toggleClass('collapsed', collapsedClass );

		dt.columns().eq(0).each( function ( colIdx, i ) {
			dt.column( colIdx ).visible( columnsVis[i] );
		} );
	}
1228027
function(options) {
        var tbody = $('<tbody></tbody>'),
            column = options.column,
            columnCount = column.length,
            data = options.data,
            rowCount = data.length;

        for (var i = 0; i < rowCount; i++) {
            var tr = $('<tr></tr>'),
                item = data[i],
                index = i + 1;

            for (var j = 0; j < columnCount; j++) {
                var col = column[j];

                if (typeof col.visible !== 'undefined' && !col.visible) {
                    continue;
                }

                if (!$.isArray(col.content)) {
                    col.content = [col.content];
                }

                var td = $('<td></td>').attr({
                    align: col.align,
                    width: col.width,
                    class: col.customClass
                });
                if (col.editable && col.content.length === 1) {
                    td.attr('editable', '');
                }
                if (this.rowSpan > 1 && col.content.length === 1) {
                    td.attr('rowspan', this.rowSpan);
                }

                var content = col.content[0].apply(this, [item, index, col.field]).toString();
                td.html((col.escapeContent === false) ? content : escapeHTML(content)).appendTo(tr);

                if (options.flexible) {
                    td.removeAttr('width');
                }
            }

            tbody.append(tr);

            if (this.rowSpan > 1) {
                for (var m = 1; m < this.rowSpan; m++) {
                    var _tr = $('<tr></tr>');
                    for (var n = 0; n < columnCount; n++) {
                        var _col = column[n];

                        if (!$.isArray(_col.content)) {
                            _col.content = [_col.content];
                        }

                        if ((typeof _col.visible !== 'undefined' && !_col.visible) || _col.content.length === 1) {
                            continue;
                        }

                        var _td = $('<td></td>').attr({
                            align: _col.align,
                            class: _col.customClass
                        });
                        var _content = _col.content[m].apply(this, [item, index, _col.field]).toString();
                        _td.html((_col.escapeContent === false) ? _content : escapeHTML(_content)).appendTo(_tr);

                        if (options.flexible) {
                            _td.removeAttr('width');
                        }
                    }
                    tbody.append(_tr);
                }
            }
        }

        return tbody.prop('outerHTML');
    }
12696
private void addColumnSelectExample() {
		add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect laid out in columns"));
		add(new ExplanatoryText("Setting the layout to COLUMN will make the check boxes be rendered in 'n' columns. The number of columns is"
				+ " determined by the layoutColumnCount property."));
		final WCheckBoxSelect select = new WCheckBoxSelect("australian_state");
		select.setToolTip("Make a selection");
		select.setButtonLayout(WCheckBoxSelect.LAYOUT_COLUMNS);
		select.setButtonColumns(2);
		add(select);

		add(new WHeading(HeadingLevel.H3, "Options equal to columns"));
		String[] options = new String[]{"Dog", "Cat", "Bird"};
		final WCheckBoxSelect select2 = new WCheckBoxSelect(options);
		select2.setToolTip("Animals");
		select2.setButtonColumns(3);
		final WTextField text = new WTextField();
		text.setReadOnly(true);
		text.setText(NO_SELECTION);

		WButton update = new WButton("Select Animals");
		update.setAction(new Action() {
			@Override
			public void execute(final ActionEvent event) {
				String output = select2.getSelected().isEmpty() ? NO_SELECTION : "The selected animals are: "
						+ select2.getSelected();
				text.setText(output);
			}
		});
		select2.setDefaultSubmitButton(update);

		add(select2);
		add(update);
		add(text);
		add(new WAjaxControl(update, text));
	}
403090
function render(code, data) {
  var js = '```js' + code + '```'
  return `<div class="vomit-snippet"><div class="column">${marked(js)}</div><div class="column"><script>
(function() {${code}document.currentScript.parentElement.appendChild(component(${JSON.stringify(data.data)}))
})()</script></div></div>`
}
485014
public function render()
	{
		/**
		 * Check whether datagrid has set some columns, initiated data source, etc
		 */
		if (!($this->dataModel instanceof DataModel)) {
			throw new DataGridException('You have to set a data source first.');
		}

		if (empty($this->columns)) {
			throw new DataGridException('You have to add at least one column.');
		}

		$template = $this->getTemplate();
		$template->setTranslator($this->getTranslator());

		/**
		 * Invoke possible events
		 */
		$this->onRender($this);

		/**
		 * Prepare data for rendering (datagrid may render just one item)
		 */
		$rows = [];

		if (!empty($this->redraw_item)) {
			$items = $this->dataModel->filterRow($this->redraw_item);
		} else {
			$items = Nette\Utils\Callback::invokeArgs(
				[$this->dataModel, 'filterData'],
				[
					$this->getPaginator(),
					$this->createSorting($this->sort, $this->sort_callback),
					$this->assembleFilters(),
				]
			);
		}

		$callback = $this->rowCallback ?: null;
		$hasGroupActionOnRows = false;

		foreach ($items as $item) {
			$rows[] = $row = new Row($this, $item, $this->getPrimaryKey());

			if (!$hasGroupActionOnRows && $row->hasGroupAction()) {
				$hasGroupActionOnRows = true;
			}

			if ($callback) {
				$callback($item, $row->getControl());
			}

			/**
			 * Walkaround for item snippet - snippet is the <tr> element and its class has to be also updated
			 */
			if (!empty($this->redraw_item)) {
				$this->getPresenter()->payload->_datagrid_redraw_item_class = $row->getControlClass();
				$this->getPresenter()->payload->_datagrid_redraw_item_id = $row->getId();
			}
		}

		if ($hasGroupActionOnRows) {
			$hasGroupActionOnRows = $this->hasGroupActions();
		}

		if ($this->isTreeView()) {
			$template->add('tree_view_has_children_column', $this->tree_view_has_children_column);
		}

		$template->rows = $rows;

		$template->columns = $this->getColumns();
		$template->actions = $this->actions;
		$template->exports = $this->exports;
		$template->filters = $this->filters;
		$template->toolbar_buttons = $this->toolbar_buttons;
		$template->aggregation_functions = $this->getAggregationFunctions();
		$template->multiple_aggregation_function = $this->getMultipleAggregationFunction();

		$template->filter_active = $this->isFilterActive();
		$template->original_template = $this->getOriginalTemplateFile();
		$template->icon_prefix = static::$icon_prefix;
		$template->icon_prefix = static::$icon_prefix;
		$template->items_detail = $this->items_detail;
		$template->columns_visibility = $this->getColumnsVisibility();
		$template->columnsSummary = $this->columnsSummary;

		$template->inlineEdit = $this->inlineEdit;
		$template->inlineAdd = $this->inlineAdd;

		$template->hasGroupActions = $this->hasGroupActions();
		$template->hasGroupActionOnRows = $hasGroupActionOnRows;

		/**
		 * Walkaround for Latte (does not know $form in snippet in {form} etc)
		 */
		$template->filter = $this['filter'];

		/**
		 * Set template file and render it
		 */
		$template->setFile($this->getTemplateFile());
		$template->render();
	}
277463
function renderSearchBox() {
      autoCollapse();
      $(window).on('resize', autoCollapse);
      $(document).on('click', '.navbar-collapse.in', function (e) {
        if ($(e.target).is('a')) {
          $(this).collapse('hide');
        }
      });

      function autoCollapse() {
        var navbar = $('#autocollapse');
        if (navbar.height() === null) {
          setTimeout(autoCollapse, 300);
        }
        navbar.removeClass(collapsed);
        if (navbar.height() > 60) {
          navbar.addClass(collapsed);
        }
      }
    }