Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Manual criteria filtering

    Hello, Isomorphic.

    We have a short question for you.
    We have a datasource which fetches it's data from some remote service (via http). Unfortunately, this service does not support fetching with some filter, so it just returns all entities. For our purposes we would like to be able to filter the results. Also, we want to do it on server side, because this fetch is called not only from client, but also from server. For this purpose, your criteria api would pass perfectly. So the question is if there is some code we can use do apply criteria to a list of maps? This should be done on server side, so com.smartgwt.client.data.DataSource.applyFilter does not work for us.
    Thanks in advance for your answer.

    Regards,
    Iaroslav

    #2
    You can use Evaluator.valuesMatchCriteria() to test whether criteria match a record on the server side. Note, this whole subsystem really exists to test single records for features such as validator.applyWhen, so it hasn't been optimized for large data volumes.

    Another approach, if the data volume isn't that high, would be to get the complete set of records over to the client and create a clientOnly DataSource from them.

    Comment

    Working...
    X