Getting Bootstrap Modals working with IDOM #526
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I was thinking that I probably need to run a JS script on click to modify the modal. For example, Is it possible to do this without writing a custom JavaScript component? |
BetaWas this translation helpful?Give feedback.
Replies: 5 comments 12 replies
-
@rmorshea Let me know if this is possible. Currently I'm stuck on getting modal popups to occur. From my side the simplest solution seems to just be running JS on-demand. The only alternative I know of is porting React Bootstrap to IDOM. |
BetaWas this translation helpful?Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Without custom components you're not going to be able to respond to even handlers with a call to some javascript code. The only thing I can think of to help this (and I'm not sure it would allow you to do what you need) would be to create a idom.html.button("click me", script="node =>{node.onclick = () => console.log('clicked!')}") |
BetaWas this translation helpful?Give feedback.
-
Also, porting importidombootstrap=idom.web.module_from_template("react", "react-bootstrap") Button=idom.web.export(bootstrap, "Button") @idom.componentdefApp(): returnidom.html.div( idom.html.link( dict( rel="stylesheet", href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css", integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3", crossorigin="anonymous", ) ), Button({"variant": "primary"}, "Primary"), ) idom.run(App) |
BetaWas this translation helpful?Give feedback.
-
I'm having similar issues with Bootstrap NavbarToggle bootstrap=idom.web.module_from_template( "react", "react-bootstrap", resolve_exports=True ) toggler=idom.web.export(bootstrap, "NavbarToggle") |
BetaWas this translation helpful?Give feedback.
-
I've determined a temporary workaround for bootstrap modals. The For now, I'll require developers to manually construct the modal contents, rather than using things like |
BetaWas this translation helpful?Give feedback.
Without custom components you're not going to be able to respond to even handlers with a call to some javascript code. The only thing I can think of to help this (and I'm not sure it would allow you to do what you need) would be to create a
scriptparameter which gets evaled on the initial render: