How can I access the 1st item of a filtered datasource?

2 posts, 0 answers
  1. Florian
    Florian avatar
    14 posts
    Member since:
    Jul 2012

    Posted 06 Nov 2012 Link to this post

    Hi,

    I am using a datasource with a filter on it.

    How can I get the 1st item of the data, which the filter returns?

    Sample: The datasource has 20 items. When I apply a filter, the filter returns only 5 items. How can I access the 1st of the 5 items and all its properties?

    Thanks
    Florian
  2. Florian
    Florian avatar
    14 posts
    Member since:
    Jul 2012

    Posted 07 Nov 2012 Link to this post

    In order to get the view of the data with applied paging, sorting, filtering etc. operations, you should use DataSource view method. Thus, getting the first item looks similar to the following:

    dataSource.view()[0]
Back to Top