Get the data of a filtered datasource

11,506

This is because the filtering is applied on the client side - and the data method returns all the data. You need to use the view method to retrieve only the visible to the end user data.

Share:
11,506
Marc-André Bilodeau-Lamontagne
Author by

Marc-André Bilodeau-Lamontagne

Updated on June 30, 2022

Comments

  • Marc-André Bilodeau-Lamontagne
    Marc-André Bilodeau-Lamontagne almost 2 years

    I'm applying a filter on a datasource and I want to retrieve all the filtered data from this datasource.

    The filter is correctly apply, my DropDownList is displaying only the filtered item, but when I want to get the data with Javascript, i'm retreiving every data and not only the filtered one.

    Here is some code :

    dropdownProduct.dataSource.query({ filter: filter }); 
    
    var data = dropdownProduct.dataSource.data();
    

    In the data variable I have all the data. Like I said, the query is working because my dropdown is only displaying the filtered data.

    What can I do to only have the filtered data in the data variable?

  • Badhon Jain
    Badhon Jain over 10 years
    ok...my situation is, I have a kendo window which loads a grid with some data, now I'm applying filtering & then want to get that filtered data to my original view & enumarete through them one by one with the down arrow press event, I can do the rest but just need to find a way to get the filtered data. Can you help me please?