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

Non-searchable field is searchable in DataTable #521

Closed
skys215 opened this issue Nov 29, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@skys215
Copy link

commented Nov 29, 2017

Hi,
I've set a field as non-searchable, i.e. "searchable": false.
Then the scaffold doesn't add this field as searchable in the repository file, which is right.
The problem is, when I type something in the search box of DataTable, it will still search this non-searchable field.

After investigation, I found that:

  1. $MODEL_NAME$DataTable.php is not using repository in the query function, it is using model, which has no any settings releated to searchable.
    Possible solution: use Repository rather then Model in query function of $MODEL_NAME$DataTable.php file.
  2. Also in the $MODEL_NAME$DataTable.php file, in the getColumns function, it has not set
    the field as 'searchable'=>false.
    Possible solution: add searchable while generating $MODEL_NAME$DataTable.php file in here.
  3. Found this after further investigation, controller.stub is using RequestCriteria, but datatable_controller.stub is not using RequestCriteria since the first commit.
    Possible solution: also add RequestCriteria into the datatable_controller. I can't think of the situation which doesn't need RequestCriteriaright now. Maybe there's some reason that why didn't add the RequestCriteria at first.

Hope to see you reply soon.

@skys215

This comment has been minimized.

Copy link
Author

commented Dec 1, 2017

@mitulgolakiya
Is this a bug or a feature?

@mitulgolakiya

This comment has been minimized.

Copy link
Member

commented Mar 20, 2019

@skys215 we have fixed searchable thing. On using a repository, I would leave it up to the user, if he wants to use, he can publish templates and do it by himself. since it's a purely choice of the user. Even lots of people requested to get rid of the repository pattern but unfortunately, so far, we do not have that option.

@skys215

This comment has been minimized.

Copy link
Author

commented Mar 20, 2019

OK, thanks for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.