Skip to content
Advertisement

Yajra/Jquery datatable how to exclude records based on condition

How can I exclude data based on my condition on the addColumn function?

What I tried is this but it will include records that are > 0

JavaScript

On the frontend side, I also tried

JavaScript

Now it hides the data but the pagination is showing for all the data. As you can see in the image below. I got 3 records but the pagination is for all the records.

enter image description here

Anyone can help? Thanks in advance.

Advertisement

Answer

I think better you can restrict in query if sum of total is greater than zero .

JavaScript

or

JavaScript

Also for yajra datatable no need to use get() .

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement