I think we shouldn't have references to html elements in viewmodel. So I think I can't do $('#id').dialog() or shouldn't do alert('message') or window.open(). Then how should I do it?
Take a look at this answer for a sample of using a custom binding to control a jQuery UI dialog from your view model.
integrating jquery ui dialog with knockoutjs
Setting an observable to true opens the dialog, setting it to false closes it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With