getVisibleCount and count in Datatable

Hi All, I have datatable of 2000 rows, I am filtering the datatable and made to appear only 5 records, and I tried to use getVisibleCount or Count to see the number of records appear after filtering, the return count is always correct, but when I try to loop through each of the 5 filtered records, the loop always iterating all the 2000 rows which I dont want to happen. I always use $$(“datatable”).count()… in the browser console I always see data.order and data.pull having the object and try to use those object. Is this the correct approach or anything wrong ?

Hello, @Jay
The thing that all operations, you perform on the datatable datastore don’t change it. That is the reason the amount of records stays the same and each new operation goes through all items.
To get an array with “filtered” data, try to use method find

Hi Alena,

First of all - Thanks a lot for the response, I have fifteen columns in my datatable, I suppose to filter the similar rows using 7- 8 column filters, how to achieve this using filter and find ?

table.find(function(obj) {
how to set the filters here programmatically, looping inside the find method is ok ??
});

even filter method also not giving me the right solution, please share any samples.

Regards

@Jay
if you need only to loop through already filtered data, try this

table.data.each(function(obj){
    ...
});

https://docs.webix.com/api__datastore_each.html

@intregal - thanks a lot :slight_smile: