public function addClose()
    {
        if ($this->recall('closed', false)) {
            $this->destroy();
        }

        $self = $this;
        /** @type Icon $icon */
        $icon = $this->add('Icon', null, 'Button');
        $icon
            ->addComponents(array('size' => 'mega'))
            ->set('cancel-1')
            ->addStyle(array('cursor' => 'pointer'))
            ->on('click', function ($js) use ($self) {
                $self->memorize('closed', true);

                return $self->js()->hide()->execute();
            });

        return $this;
    }
public function addClose()
    {
        if ($this->recall('closed', false)) {
            $this->destroy();
        }

        $self = $this;
        /** @type Icon $icon */
        $icon = $this->add('Icon', null, 'Button');
        $icon
            ->addComponents(array('size' => 'mega'))
            ->set('cancel-1')
            ->addStyle(array('cursor' => 'pointer'))
            ->on('click', function ($js) use ($self) {
                $self->memorize('closed', true);

                return $self->js()->hide()->execute();
            });

        return $this;
    }
public function addClose ( ) { if ( $ this -> recall ( 'closed' , false ) ) { $ this -> destroy ( ) ; } $ self = $ this ; /** @type Icon $icon */ $ icon = $ this -> add ( 'Icon' , null , 'Button' ) ; $ icon -> addComponents ( array ( 'size' => 'mega' ) ) -> set ( 'cancel-1' ) -> addStyle ( array ( 'cursor' => 'pointer' ) ) -> on ( 'click' , function ( $ js ) use ( $ self ) { $ self -> memorize ( 'closed' , true ) ; return $ self -> js ( ) -> hide ( ) -> execute ( ) ; } ) ; return $ this ; }
View box can be closed by clicking on the cross.

@return $this
View box can be closed by clicking on the cross .