RadListView not refreshing correctly

Thread is closed for posting
5 posts, 0 answers
  1. Henrique
    Henrique avatar
    12 posts
    Member since:
    Mar 2017

    Posted 21 Mar 2017 Link to this post

    I have a RadListView "linked" to an observableArray of <FoodItems> (which is my own type/obj). This object has one property that holds the css class, which I use to change the background color, called "listItemClass"

    <lv:RadListView.itemTemplate class="list-view-item-template">
                    <GridLayout columns="*, auto" rows="30, auto" class="{{ listItemClass }}" >

     

    Then, on the "itemSelected(args)" event I change the css style, to reflect that this item has been selected. I explicitly call listView.refresh(); to refresh the page.

    This works, almost always. After hours of debugging and trying different techniques to make the list refresh, I pin pointed the issue; If I click the first element of the list, then it selects it, but the view doesn't refresh, so the new background style doesn't show. I have console logs and a UI Label showing that the item was selected. It happens on the first item and on item number 9, which makes it more weird. All others work fine, I tap the item and the background style changes it. 

    I recorded a screencast that shows the issue, it's on dropbox and can be viewed following this link:

    https://www.dropbox.com/s/a9s8m8h76oqizao/RadListView_refresh_issue.mp4?dl=0

    Would you have any idea on what am I doing wrong? And, what should I do to fix it so that it always refresh list view. 

    Thank you! 

  2. Henrique
    Henrique avatar
    12 posts
    Member since:
    Mar 2017

    Posted 21 Mar 2017 Link to this post

    I've changed back to the regular ListView and the refresh works like a champ. It sucks that I'm gonna have to go back to using the regular ListView instead of RadListView, because of all the extra features. 

    I hope you can find a workaround for me. 

     

    Thank you! 

  3. Deyan
    Admin
    Deyan avatar
    2147 posts

    Posted 22 Mar 2017 Link to this post

    Hi Henrique,

    Thanks for writing.

    This doesn't sound like a correct behavior and we are willing to investigate and address the problem. Can you please provide the source code of your scenario so that we try to reproduce it on our side and directly take a look at the code?

    Which platform does this happen on?

    Regards,
    Deyan
    Telerik by Progress
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
  4. Henrique
    Henrique avatar
    12 posts
    Member since:
    Mar 2017

    Posted 22 Mar 2017 in reply to Deyan Link to this post

    Hi, thanks for the response. I replaced the RadListView for the regular ListView yesterday and it works perfectly. I'm gonna gather some working code to give you as an example when I have a minute. Thank you
  5. Deyan
    Admin
    Deyan avatar
    2147 posts

    Posted 23 Mar 2017 Link to this post

    Hello Henrique,

    There are a couple of fixes which we have introduced in RadListView for the upcoming release of NativeScript UI that might address this behavior.

    We will try to reproduce it on our side to see if it happens with the new bits as your video gives a brief idea of what the scenario is.

    For the time being, I would like to ask you to share the logic behind the model.isAlreadySelected and model.addToSelected methods.

    Thanks!

    Regards,
    Deyan
    Telerik by Progress
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
Back to Top