How to clear selection of alternate list

3 posts, 1 answers
  1. Abhishek
    Abhishek avatar
    16 posts
    Member since:
    Apr 2011

    Posted 27 Sep 2014 Link to this post

    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. Answer
    Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 01 Oct 2014 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Abhishek
    Abhishek avatar
    16 posts
    Member since:
    Apr 2011

    Posted 07 Oct 2014 in reply to Alexander Popov Link to this post

    Thanks Alexander - It solved the issue.

    Thanks a lot!.
Back to Top