This is a migrated thread and some comments may be shown as answers.

Combination of issues with ScrollView and DataSource filtering

5 Answers 82 Views
ScrollView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Artie
Top achievements
Rank 1
Artie asked on 15 Jul 2015, 05:45 PM

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.

5 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 17 Jul 2015, 02:17 PM
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!
 
0
Artie
Top achievements
Rank 1
answered on 17 Jul 2015, 03:42 PM
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?
0
Petyo
Telerik team
answered on 21 Jul 2015, 07:47 AM
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!
 
0
Accepted
Alexander Valchev
Telerik team
answered on 31 Aug 2015, 09:11 AM
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!
 
0
Artie
Top achievements
Rank 1
answered on 31 Aug 2015, 03:03 PM
I just tested with Kendo 2015.2.805 and verified that it's been fixed, thanks!
Tags
ScrollView (Mobile)
Asked by
Artie
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Artie
Top achievements
Rank 1
Alexander Valchev
Telerik team
Share this question
or