Combination of issues with ScrollView and DataSource filtering

6 posts, 1 answers
  1. Artie
    Artie avatar
    29 posts
    Member since:
    May 2015

    Posted 15 Jul 2015 Link to this post

    For a project we are working on, we have a ScrollView pointing to a local data source (per customer requirements).  This data source needs to be filterable by a few fields, which seems to work properly until we run into a scenario where we need to "clear" our filters.  I've recreated our scenario within the Dojo, the link is below.  I can demonstrate the two issues we are seeing by performing the following:

    1. Simply click "Set Filter".  Notice that nothing happens, unless you click "Set Filter" again. If you uncomment this line in setFilter, you will see that pushing the button "works" the first time: 
      // ds.filter({});
       Can you explain why this is the case?
    2.  Re-running the example from scratch, you will notice if you click on any of the items, it renames it by fetching it from the data source and then calling ".set()" on that object.  Now, if you hit "Set Filter" and then "Reset Filter", try swiping to the 2nd or 3rd page and then clicking on one of the items.  The item is updated, but the ScrollView switches itself back to the first page.  This only seems to happen *after* filter(filter) has been called on the DataSource the first time and then one of the objects is modified, before filter() is called then it works as expected.  I was looking at the filter() function within the compressed Kendo source, and although I don't understand what "t" is you can clearly see "what" is happening, just not "why": 
      function filter(e){
        var n=this;
        return e===t?n._filter:(n._query({filter:e,page:1}),n.trigger("reset"),t)
      }

    That was actually the first time I've seen syntax like that in Javascript, where the second half of a shorthand if/else executes a function call wrapped in parentheses.  Aside from trying to get around these issues, what is the "correct" way to remove filters from a data source?  I didn't see anything in the documentation and there are some pretty varied opinions on the web about how to do this.

    Here's a link to the example: http://dojo.telerik.com/egadU/2

    We are developing with version 2015.1.429, but I replicated this using 2015.2.624 within the Dojo.

  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 17 Jul 2015 Link to this post

    Hi Arthur,

    Thank you for the provided test case - please excuse us for the trouble. Both of the issues you have hit seem like a bug in the scrollview implementation - it does not react as expected to the filtering of the datasource. For the time being, I may suggest this workaround. We have logged the problem and will investigate it further.


    Regards,
    Petyo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Artie
    Artie avatar
    29 posts
    Member since:
    May 2015

    Posted 17 Jul 2015 in reply to Petyo Link to this post

    Thanks for the reply, that definitely helps.  I do have one follow-up question though.  The sample you provided still exhibits the exact same behavior the first time after any filter reset...clicking on an item will change its name and then scroll back to the first page.  However, clicking any subsequent items will allow those to be changed without the scrollview resetting.  If you click "Reset Filter" again, it's the same: the first click triggers the problem, subsequent ones do not.  Is there anything that can be done to eliminate the problem on that first click?
  5. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 21 Jul 2015 Link to this post

    Hi Arthur,

    this seems like another symptom of the same bug. The behavior should be consistent; in general, I would expect the scrollview to rebind itself (and reset its pager) every time.

    We will investigate both issues and get back to you as soon as possible. I am marking this thread as requiring an additional answer on our side.  

    Regards,
    Petyo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Answer
    Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 31 Aug 2015 Link to this post

    Hi Arthur,

    The issue has been fixed. Please upgrade your project and let me know if the problem still persists.

    Regards,
    Alexander Valchev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  7. Artie
    Artie avatar
    29 posts
    Member since:
    May 2015

    Posted 31 Aug 2015 Link to this post

    I just tested with Kendo 2015.2.805 and verified that it's been fixed, thanks!
Back to Top
Kendo UI is VS 2017 Ready