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?
Click on the "Edit" option that placed on the top right corner near to Extract button. It opens the "Extract data" window. Click on the "Add" option present in the Window.
To create a data source filter On the data source page, click Add in the Filters section in the upper-right corner of the page. To create a data source filter on a worksheet, right-click (control-click on a Mac) the data source and choose Edit Data Source Filters.
To apply the filter to all worksheets that use related data sources, right-click the field on the Filters shelf and select Apply to worksheets > All using related data sources.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With