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

MVVM auto focus

1 Answer 98 Views
Window
This is a migrated thread and some comments may be shown as answers.
Matjaz
Top achievements
Rank 1
Matjaz asked on 01 Dec 2014, 09:09 AM
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.

1 Answer, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 03 Dec 2014, 07:57 AM
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!
 
Tags
Window
Asked by
Matjaz
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or