public function getEncodedOptions()
    {
        $options = [];

        foreach ($this->options as $key => $value) {
            if ($value === null) {
                continue;
            }
            $options[$key] = $this->encode($value);
        }

        return Json::encode($options);
    }