QuickSearch::init PHP Method

init() public method

Initialization.
public init ( )
    public function init()
    {
        parent::init();
        // template fixes
        $this->addClass('atk-form atk-form-stacked atk-form-compact atk-move-right');
        $this->template->trySet('fieldset', 'atk-row');
        $this->template->tryDel('button_row');
        $this->addClass('atk-col-3');
        // add field
        $this->search_field = $this->addField('Line', 'q', '')->setAttr('placeholder', 'Search')->setNoSave();
        // cancel button
        if ($this->show_cancel && $this->recall($this->search_field->short_name)) {
            $this->add('View', null, 'cancel_button')->setClass('atk-cell')->add('HtmlElement')->setElement('A')->setAttr('href', 'javascript:void(0)')->setClass('atk-button')->setHtml('<span class="icon-cancel atk-swatch-red"></span>')->js('click', array($this->search_field->js()->val(null), $this->js()->submit()));
        }
        /** @type HtmlElement $b Search button */
        $b = $this->add('HtmlElement', null, 'form_buttons');
        $b->setElement('A')->setAttr('href', 'javascript:void(0)')->setClass('atk-button')->setHtml('<span class="icon-search"></span>')->js('click', $this->js()->submit());
    }