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

How to clear selection of alternate list

2 Answers 213 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Abhishek
Top achievements
Rank 1
Abhishek asked on 27 Sep 2014, 11:17 AM
Hi,

 We have 2 ListView controls. When user clicks on one ListView, we want to clear any selection on the other list. So we called clearSelection() on the other ListView's change event, for both the ListView controls. But its giving error as 'apply' already in progress - we are using Angular version of the controls.

 Please let me know how we can fix this.

Thanks a lot.

2 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Popov
Telerik team
answered on 01 Oct 2014, 06:12 AM
Hello Abhishek,

Clearing the selection also triggers the change event, so you might end up with an infinite loop. As a workaround I would suggest checking if the ListView has any selection before clearing the other one's. For example: 
$scope.listView1onChange = function(e){
  if(this.select().length){
    $("#listView2").getKendoListView().clearSelection(); 
  }
}
 
$scope.listView2onChange = function(e){
  if(this.select().length){
    $("#listView1").getKendoListView().clearSelection(); 
  }
}


Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Abhishek
Top achievements
Rank 1
answered on 07 Oct 2014, 05:31 PM
Thanks Alexander - It solved the issue.

Thanks a lot!.
Tags
ListView
Asked by
Abhishek
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Abhishek
Top achievements
Rank 1
Share this question
or