darrachequesne / spring-data-jpa-datatables

Spring Data JPA extension to work with the great jQuery plugin DataTables (https://datatables.net/)
Apache License 2.0
441 stars 174 forks source link

Server side filtering #62

Closed JelleBlaauw closed 6 years ago

JelleBlaauw commented 6 years ago

How to apply server side filtering? findAll obviously returns all columns, but there seems to be no way other than creating a whole new object to remove columns from the result. I tried messting around with the DataTablesInput object in my controller, but this didn't change the result.

Could you please help me out?

darrachequesne commented 6 years ago

You can add an additional Specification with:

repository.findAll(input, specification);

Please see here for an example.

JelleBlaauw commented 6 years ago

Thanks. It took some time to figure out how the Specification API works, but that's a non-datatables related issue.

This issue may be closed.