Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request : Optionnal global searchForm #58

Closed
Nuranto opened this issue Jun 16, 2018 · 6 comments · Fixed by #62
Closed

Feature request : Optionnal global searchForm #58

Nuranto opened this issue Jun 16, 2018 · 6 comments · Fixed by #62
Assignees
Labels
enhancement An enhancement to an existing feature

Comments

@Nuranto
Copy link

Nuranto commented Jun 16, 2018

{!! $grid->renderSearchForm() !!}
is not always wanted, but ATM, we cannot enable/disable it per grid.

@leantony
Copy link
Owner

Noted. Looking into this

@leantony leantony self-assigned this Jun 16, 2018
leantony added a commit that referenced this issue Jun 16, 2018
@leantony
Copy link
Owner

leantony commented Jun 16, 2018

I've added a fix;
Try creating your grid with;

class UsersController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @param UsersGridInterface $usersGrid
     * @param Request $request
     * @return \Illuminate\Http\Response
     */
    public function index(UsersGridInterface $usersGrid, Request $request)
    {
        return $usersGrid
                    ->create(['query' => User::query(), 'request' => $request])
                    ->withoutSearchForm() // this disables the search form for that grid without you setting/unsetting any variables
                    ->renderOn('users.index');
    }
}

Or simply just override the property $shouldRenderSearchForm on any grid, and set it to true/false

@leantony
Copy link
Owner

If youre using 2.0.x-dev, running composer update should get you this fix.

@Nuranto
Copy link
Author

Nuranto commented Jun 17, 2018

I tried 2.0.x-dev, but the fix is not grabbed ?

@leantony
Copy link
Owner

Aah, forgot to merge that fix to master. Try again in a few minutes...

@Nuranto
Copy link
Author

Nuranto commented Jun 18, 2018

Works fine !

@leantony leantony added the enhancement An enhancement to an existing feature label Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement to an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants