webinarium / DataTablesBundle

Symfony bundle for DataTables plugin.
MIT License
16 stars 9 forks source link

Update Example #11

Closed laurentmuller closed 5 years ago

laurentmuller commented 5 years ago

Version: 2.3.1 Bug: No

Description: In your example, You set filtered count after sorting the columns. But this is not necessary because the number of records are the same and the query is slower.

So call first:

// Get filtered count.
$queryCount = clone $query;
....

Then;

// Order.
foreach ($request->order as $order) {
....

Thank You for your excellent bundle !!

webinarium commented 5 years ago

You are right - I have updated the example, thank you!