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

RadListView not refreshing correctly

4 Answers 216 Views
ListView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Henrique
Top achievements
Rank 1
Henrique asked on 21 Mar 2017, 06:55 PM

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! 

4 Answers, 1 is accepted

Sort by
0
Henrique
Top achievements
Rank 1
answered on 21 Mar 2017, 07:56 PM

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! 

0
Deyan
Telerik team
answered on 22 Mar 2017, 08:17 AM
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.
0
Henrique
Top achievements
Rank 1
answered on 22 Mar 2017, 04:09 PM
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
0
Deyan
Telerik team
answered on 23 Mar 2017, 08:56 AM
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.
Tags
ListView
Asked by
Henrique
Top achievements
Rank 1
Answers by
Henrique
Top achievements
Rank 1
Deyan
Telerik team
Share this question
or