diff --git a/src/Grid/Filter/Group.php b/src/Grid/Filter/Group.php index d982759fa..cd905d4c5 100755 --- a/src/Grid/Filter/Group.php +++ b/src/Grid/Filter/Group.php @@ -256,7 +256,7 @@ public function condition($inputs) $this->value = $value; - $group = Arr::get($inputs, "{$this->id}_group"); + $group = Arr::get($inputs, "{$this->sanitizeId()}_group"); if ($this->group->isEmpty()) { call_user_func($this->builder, $this); @@ -267,6 +267,18 @@ public function condition($inputs) } } + /** + * Sanitize the filter id. + * + * @return string + */ + protected function sanitizeId() + { + if ($prefix = $this->parent()->grid()->getNamePrefix()) + return str_replace($prefix, '', $this->id); + return $this->id; + } + /** * Inject script to current page. */