Is there any function to query matched records and to get count webix datatable store?

Is there any function to query matched records and to get count webix datatable store?

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

store.find(condition).length;

is this work for both filtered and non-filtered store correctly?

Here i need to filter already filtered records using dataIndex and values, how can we do this?

there is a function which will do this, but it is private function. I don’t know why you guys making such useful functions as private, like many i have seen in webix.js all are private functions because of this we need to write some nasty code to come out from situation.

if you need to filter already filtered data, then use filter with preserve=true
https://docs.webix.com/api__link__ui.datatable_filter.html
data.filter(handler, true)
then use count to get filtered data count.

but if you need to just find required data, you need to use find method.
to apply find on already filtered data, you can check like that

data.find(function(obj){
    if (data.getIndexById(obj.id)==-1) return false; // not in filtered data
    ... other conditions
})

I think this will [data.filter(handler, true)] filter datatable but i am just querying store.

Second one you gave it will loop through all records

Second one you gave it will loop through all records
if (data.getIndexById(obj.id)==-1) return false; // not in filtered data

I understand it won’t execute entire function it will return but loop will happen for all records.

Why i am asking this question is i have nearly 50K records i need to get count frequently.

There is some thing called “table.data.order” which will have filtered record id’s but not record instance. i can use this but again i need to get every record instance

Any way thanks for your replies

maybe this helps you

var filtered = [];
table.data.each(function(obj){//will iterate through already filtered data
    if(obj.match_conditions){
        filtered.push(obj)
    }
});
alert(filtered.length);

This is perfect till now.

Thanks