MVVM auto focus

2 posts, 1 answers
  1. Matjaz
    Matjaz avatar
    94 posts
    Member since:
    Jun 2014

    Posted 01 Dec 2014 Link to this post

    How can I activate (focus) window which is not opened with open method, but with MVVM. I need window is focused when page loaded. In your example autoFocus with MVVM is not working.
  2. Answer
    Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 03 Dec 2014 Link to this post

    Hi Matjaz,

    You may use the jQuery focus method. Please check the following example:
    Note that the window's visibility is bound to the toggleVisibility method of the ViewModel.

    toggleVisibility: function() {
      setTimeout(function() {
        $("#myWindow").focus();
      });
        return this.get("isVisible");
    },


    I hope this approach will fit in your scenario.

    Regards,
    Alexander Valchev
    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
Back to Top