-
-
Notifications
You must be signed in to change notification settings - Fork 425
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: Columns should be searchable via the API, even if they were disabled during DataTable initialization #210
Comments
Yes, rather than just being a boolean option, it might be nice to allow it to be It isn't something I'm going to be adding soon though I'm afraid. This is the first request I can recall for this and it isn't something I've required myself yet. Will leave open for future thought. |
I brought this up because I spent several hours one day at work trying to figure out what was wrong with my code, only to realize towards the end (after going through 2 other developers) that I had set one of the columns to disabled, but also that column was being searched via the API. |
@AllanJard I've been working on a PR to address this issue. However, I noticed something interesting and would like your input. I noticed that sometime back there was a change to the core.filter.js file adding an oInput.return argument when calling the _fnFilter() function: However there is no such parameter in the _fnFilter() function. Here is its current signature: Would you like me to remove the argument oInput.return in this PR or make a separate PR removing it? What do you see is the best path forward? |
Good spotting! I've gone ahead and fixed that, as it is just wrong. Thanks for letting me know! |
…nt count on internal filtering call Relates to DataTables/DataTablesSrc#210 df587f100c1f32013a0e07ccb8f96dea99e1cc3b Merge branch 'master' of github.com:DataTables/DataTablesSrc Sync to source repo @df587f100c1f32013a0e07ccb8f96dea99e1cc3b
…nt count on internal filtering call Relates to DataTables/DataTablesSrc#210 df587f100c1f32013a0e07ccb8f96dea99e1cc3b Merge branch 'master' of github.com:DataTables/DataTablesSrc Sync to source repo @df587f100c1f32013a0e07ccb8f96dea99e1cc3b
…nt count on internal filtering call Relates to DataTables/DataTablesSrc#210 df587f100c1f32013a0e07ccb8f96dea99e1cc3b Merge branch 'master' of github.com:DataTables/DataTablesSrc Sync to source repo @df587f100c1f32013a0e07ccb8f96dea99e1cc3b
…nt count on internal filtering call Relates to DataTables/DataTablesSrc#210 df587f100c1f32013a0e07ccb8f96dea99e1cc3b Merge branch 'master' of github.com:DataTables/DataTablesSrc Sync to source repo @df587f100c1f32013a0e07ccb8f96dea99e1cc3b
…nt count on internal filtering call Relates to DataTables/DataTablesSrc#210 df587f100c1f32013a0e07ccb8f96dea99e1cc3b Merge branch 'master' of github.com:DataTables/DataTablesSrc Sync to source repo @df587f100c1f32013a0e07ccb8f96dea99e1cc3b
…nt count on internal filtering call Relates to DataTables/DataTablesSrc#210 df587f100c1f32013a0e07ccb8f96dea99e1cc3b Merge branch 'master' of github.com:DataTables/DataTablesSrc Sync to source repo @df587f100c1f32013a0e07ccb8f96dea99e1cc3b
…nt count on internal filtering call Relates to DataTables/DataTablesSrc#210 df587f100c1f32013a0e07ccb8f96dea99e1cc3b Merge branch 'master' of github.com:DataTables/DataTablesSrc Sync to source repo @df587f100c1f32013a0e07ccb8f96dea99e1cc3b
…nt count on internal filtering call Relates to DataTables/DataTablesSrc#210 df587f100c1f32013a0e07ccb8f96dea99e1cc3b Merge branch 'master' of github.com:DataTables/DataTablesSrc Sync to source repo @df587f100c1f32013a0e07ccb8f96dea99e1cc3b
…nt count on internal filtering call Relates to DataTables/DataTablesSrc#210 df587f100c1f32013a0e07ccb8f96dea99e1cc3b Merge branch 'master' of github.com:DataTables/DataTablesSrc Sync to source repo @df587f100c1f32013a0e07ccb8f96dea99e1cc3b
Currently, attempting to search a column via the API when searching on that column has been disabled does not return anything. I'm posting this feature request because I think that some columns may not be appropriate to search on via the search field, however through one or more filters after a search, such a column ought to be searched on. I'll try to clarify with a proof of concept.
To play around with this POC yourself, I have provided the following gists:
eligibleEmployees.html: https://gist.github.com/MisterVector/6cbbb74b74d5af7556472ec8681a5b64
eligibleEmployees.js: https://gist.github.com/MisterVector/d8b7a6c3f7b02bfce2d268c86a720ea8
The POC starts off with this table:
Scenario 1 below illustrates my point that some columns aren't appropriate to search on:
Scenario 2 shows the "Show only employees eligible for promotion" option checked, which shows only the employees eligible for promotion:
With the "Disable third column for search?" item checked, scenario 3 shows that performing the same search will not show any results, as that column has been disabled:
For scenario 4, both checkboxes have been checked, which disables the third column for search and performs a search on that column using the API, which turns up no results:
I'm suggesting that scenario 4 should show the intended results, regardless if the searching capabilities of that column are disabled or not.
This probably makes more sense if the column was hidden. You would disable it at initialization to make sure the hidden column is not selected when searching but then perform a search on that column using the API.
The text was updated successfully, but these errors were encountered: