code: public function init()
      {
          parent::init();
          if ($this->formatter === null) {
              $this->formatter = Yii::$app->getFormatter();
          } elseif (is_array($this->formatter)) {
              $this->formatter = Yii::createObject($this->formatter);
          }
          if (!$this->formatter instanceof Formatter) {
              throw new InvalidConfigException('The "formatter" property must be either a Format object or a configuration array.');
          }
          if (!isset($this->filterRowOptions['id'])) {
              $this->filterRowOptions['id'] = $this->options['id'] . '-filters';
          }
  
          $this->initColumns();
      }
docs: Initializes the grid view.
  This method will initialize required property values and instantiate [[columns]] objects.