-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Onsen2: ons-sliding-menu w/o angular #1038
Comments
Hi @luposlip! Thanks a lot for trying out the beta. It's really appreciated :) Actually we made a decision to create the Is it possible for you to use The reason we created the
If the demand is high, we will considering releasing a sliding menu component that is not dependent on Angular. However, we prefer improving the |
Oh man, I didn't realize the ons-splitter mimics the behaviour of the ons-sliding-menu, also in terms of touch-sliding. But I see it does, now that I've just tested your live demo on a device. Thanks a bunch, then I don't need the ons-sliding-menu going forward! :) Closing this issue. Best, |
Well, actually I can't get the ons-splitter to work. I need an example of its usage without Angular. The examples you have are Angular only, and the reference you have on how to use the components without Angular is for Onsen1.x. Can you supply me with an example of how to use ons-splitter without Angular? I need: 1: HTML incl. setting the attributes (I use a system where I need well formed HTML, like:
2: Javascript for handling opening/closing the splitter/menu, Javascript for handling change of page (with or without templates) What I have now is a page that looks alright, but I can't seem to get the splitter to react to anything I do. It's also closed by default. In the browser console I can get the ons-splitter-side with this:
When I call I've also tried to point the content of ons-splitter-content to a template page with markup like this:
This renders the content area empty. If you could add such an example here or to your repo, I'd highly appreciate it! Thanks. Best, EDIT: I can get it to work if I put the ons-splitter, ons-splitter-side and ons-splitter-content elements in plain HTML, and then just generate the content with react. But not if I generate the full UI with react (which isn't really that important right now, but it should work I guess?) |
I have this issue too. I've tried everything and the component won't work; also I can't swipe it. Btw, v2 looks awesome! |
Any update on an example using JavaScript only? |
I made a super simple example. http://codepen.io/argelius/pen/vLEBPZ The menu is toggled by selecting the const toggleMenu = () => {
document.getElementById('menu').toggle();
}; <ons-toolbar-button
onclick="toggleMenu()"
modifier="material">
<ons-icon icon="md-menu"></ons-icon>
</ons-toolbar-button> |
You can change the content of the splitter view like this: <script>
function showPage(page) {
document.getElementById("splitter").loadContentPage(page);
};
</script>
<ons-splitter id="splitter">
<ons-splitter-content page="entry.html"></ons-splitter-content>
<ons-splitter-side id="menu" side="left" width="150px" swipeable collapse>
<ons-list>
<ons-list-item modifier="chevron" onclick="showPage('page1.html');">
Page 1
</ons-list-item>
</ons-list>
</ons-splitter-side>
</ons-splitter>
<ons-template id="entry.html">
... (Content of entry page)
</ons-template>
<ons-template id="page1.html">
... (Content of page 1)
</ons-template> This code loads 'entry.html' at startup. Clicking on the list item in the 'ons-splitter-side' menu changes the content to 'page1.html'. |
I still (2.0.0-rc4) can't |
@luposlip We made some components for React: https://github.com/OnsenUI/react-onsenui Have you tried them out? There is a side menu in this app: http://onsenui.github.io/react-onsenui-kitchensink/demo.html |
Now we have a working VanillaJS example for Closing this. |
Hi there!
Spent some time yesterday moving my an app from Onsen1.x to the new Onsen2 beta.
But then I saw that ons-sliding-menu is angular-only. Do you have any plans on making this work without angular? The primary reason for me to upgrade to Onsen2 is to loose angular.
Thanks!
Best,
Henrik
The text was updated successfully, but these errors were encountered: