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

Fix: server-side columns().search() call passes empty string to _fnFi… #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zeigotaro
Copy link

…lterComplete

Server-side issue, difficult to set up test page using publicly
available sAjaxSource that handles DataTables-specific parameters

…lterComplete

Server-side issue, difficult to set up test page using publicly
available sAjaxSource that handles DataTables-specific parameters
@DataTables
Copy link
Collaborator

Could you clarify what issue this change fixes please?

Using this example if I open the console and enter:

$('#example').DataTable().column(0).search('Airi').draw()

It correctly reduces to a single row. Then:

$('#example').DataTable().column(0).search('').draw()

correctly removes the filter.

@zeigotaro
Copy link
Author

I'm running into an issue where, with aoColumnDefs set, settings.oPreviousSearch does not have the sSearch field set correctly. Changing that call to _fnFilterComplete to match the call used for _api_register( 'search()'...) (the function above) fixes the issue I'm seeing.

@DataTables
Copy link
Collaborator

Are you able to modify this server-side processing example to demonstrate the issue please. I don't see why defining columnDefs would make any difference to the column search API.

@zeigotaro
Copy link
Author

Thank you for setting that example up. I've modified it, but the behavior I'm seeing on the JSBin is different than what I'm encountering (I'm using a JsonResult created with the DataTablesParser in the DataTablesDotNet library). I can workaround on my end by uncommenting that "oSettings.oPreviousSearch.sSearch" assignment. If you do not feel this is a productive fix, feel free to close. Thanks for your help. :-)

@DataTables
Copy link
Collaborator

Have you got a link to the DataTablesDotNet library? I wonder if it is a bug there.

I'd like to take the fix, but before I do I need to understand what the bug is :-).

@zeigotaro
Copy link
Author

https://github.com/timhobbs/DataTablesDotNet is where that library is located. Thanks!

@DataTables
Copy link
Collaborator

Great thanks. I'll try to take a look before the 1.10.8 release drops.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants