I think you could add the .modal('show') as an extension method on JQuery:

1
2
3
4
5
open WebSharper.JQuery

type JQuery with
    [<Inline "$0.modal('show')">]
    member this.ModalShow() = this

And then add this attribute to the main div of your showError:

1
on.afterRender (fun div -> JQuery.Of(div).ModalShow().Ignore)
By on 12/9/2015 2:59 AM ()

Thanks, but it does not work :(

By on 12/9/2015 3:34 AM ()

I am not sure why your modal isn't opening but this is how I am opening modals in my code. I have a module which installs a modal in the current page and returns a method to open it. https://gist.github.com/Kimserey/10119331280aae690b41:

1
2
3
4
5
6
7
8
9
10
let modalOptions = {
	Title = "Title of modal"
   	Content = p [ text "Some content" ]
    PositiveAction = (Title "Continue", Action (fun () -> JS.Alert "continue"))
    NegativeAction = (Title "Cancel", Action (fun () -> JS.Alert "cancel!"))
}

div [
	Doc.Button "open" [] (install modalOptions)
]

It works fine as long as I don't forget to reference bootstrap js. I know it doesn't solve your issue but hope it can help.

By on 12/10/2015 8:44 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper