public function isValid($sendHeaders = true)
    {

        app(\Antares\Html\Adapter\CustomfieldAdapter::class)->adapt($this->grid);
        $decryptedKey = is_null($key          = Input::get('key')) ? null : Crypt::decrypt($key);


        if ($this->grid->ajaxable !== false && !$this->container->make('antares.request')->shouldMakeApiResponse()) {
            $clientScript = $this->clientScript->addClientValidation($this->grid);
            $fieldsets    = $clientScript['fieldsets'];
            $this->fieldPermissionAdapter->resolveFields($fieldsets, $decryptedKey);

            $this->rules($fieldsets);
        } else {

            $fieldsets = $this->grid->fieldsets();
            $this->fieldPermissionAdapter->resolveFields($fieldsets, $decryptedKey);

            $this->rules($fieldsets);
        }
        $validator        = $this->validator->with($this->grid);
        $validator->withCustomFields($this->customFieldsValidator);
        $result           = $validator->validate($sendHeaders);
        $this->messageBag = $validator->getMessageBag();
        return $result;
    }