Update pagination and info after manual search

Update pagination and info after manual search

tatuleatatulea Posts: 3Questions: 1Answers: 0

Hi,

I made a manual search for my custom input search.

$(".datatable").DataTable().columns(columns_to_search).search($(this).val()).draw();

The problem is that after it updates my table, the info and pagination are not updated. How can update them regarding to the number of search returned rows.

Thank you,

Answers

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947

    Are you using server side processing?

    If so then look at the server side script to see what its returning for those values. Maybe its not reflecting the search results in the counters.

    Otherwise maybe you can post a link or test case showing the issue.

    Kevin

  • tatuleatatulea Posts: 3Questions: 1Answers: 0

    Yes, I am using https://github.com/pivotal-energy-solutions/django-datatable-view.

    The problem is that the request on search sets columns as well. I mean, if I do just

    $(".datatable").DataTable().search($(this).val()).draw();
    

    it works good, but if I put the columns filter, the request is like columns[0][search][value]=..., columns[1][search][value]=..., etc

  • tatuleatatulea Posts: 3Questions: 1Answers: 0

    The request without columns search is like search[value]': 'dec'. The request with columns have search[value]: '' and each column have columns[0][search][value]: 'dec'

  • allanallan Posts: 63,468Questions: 1Answers: 10,466 Site admin

    The variables that DataTables sends to the server-side are fully documented here.

    Do you actually need server-side processing? Are you working with tens of thousands or more rows? If not, disable server-side processing.

    If you do need it, then it looks like your need to debug that server-side script to see if it handles column filters correctly or not.

    Allan

This discussion has been closed.