jQuery UI Widgets › Forums › Vue › How to dynamically generate nodes in the NavigationBar component
Tagged: navigationbar
This topic contains 8 replies, has 3 voices, and was last updated by admin 3 years, 12 months ago.
-
Author
-
September 21, 2020 at 1:15 am How to dynamically generate nodes in the NavigationBar component #113113
<template>
<JqxSplitter
:width=”‘100%'”
:height=”‘93.7%'”
:panels=”[{ size: 200 }]”>
<div class=”splitter-panel”>
<JqxNavigationBar
class=”jqx-hideborder”
:expandMode=”‘multiple'”
:theme=”theme”
>
<div>
<div style=”margin-top: 2px;”>
<div style=’float: left;margin-left:5px;height:30px;’>
</div>
<div style=”margin-left:8px;margin-top:5px; float: left;”>
products
</div>
</div>
</div>
<div></div>
…</JqxNavigationBar>
</div>
<div class=”splitter-panel”>
<JqxTabs
:width=”tabs.width”
:height=”tabs.height”
:theme=”theme”
:position=”tabs.position”
:animationType=”tabs.animationType”>-
<li style=”margin-left: 10px;”>home
<div>
<WelcomPage
:width=”‘100%'”
:height=”‘100%'”
></WelcomPage>
</div>
</JqxTabs>
</div>
</JqxSplitter>
</template>The demo shows a fixed template, but in actual business,the scale may be very large , and these nodes should be dynamically generated, how should I do
September 21, 2020 at 10:30 am How to dynamically generate nodes in the NavigationBar component #113117Hello JenkeNg,
The jqxNavigationBar has add method that you could use for generating new nodes.
Best Regards,
Martin YotovjQWidgets team
https://www.jqwidgets.comSeptember 22, 2020 at 12:42 am How to dynamically generate nodes in the NavigationBar component #113121this.$refs.myNavigationBar.add(
<div> <div style="margin-top: 2px;"> <div style='float: left;margin-left:5px;height:30px;'> </div> <div style="margin-left:8px;margin-top:5px; float: left;">xxx</div> </div> </div>`, `<div> <ul class="submenu">
- 111
- 222
- 333
</div>` );The picture address here will not be valid
src="../assets/icon/product.png"
I tried this method and it works. But there is another problem. The image will not be displayed for the nodes added by this method. The image address of the fixed template seems to be compiled, but the image address of the added node is not compiled, how can I change it.
September 22, 2020 at 10:35 am How to dynamically generate nodes in the NavigationBar component #113126And how do I bind the click event to the
<li> in the <ul></ul></li>
September 25, 2020 at 10:14 am How to dynamically generate nodes in the NavigationBar component #113157Hello JenkeNg,
Please, note that the add method have 2 arguments: header and content.
You can check the following Example for adding items with images in the jqxNavigationBar for Vue.Best Regards,
Martin YotovjQWidgets team
https://www.jqwidgets.comSeptember 27, 2020 at 7:32 am How to dynamically generate nodes in the NavigationBar component #113164I think the way the JqxNavigationBar component is generated is very unreasonable.
Its members are a group of two, which violates the constraint that the vue template has only one root,
so that I can only write all the members as non-dynamic when using this component. Instead of using v-for to generate dynamically.
I think two members (div of the parent menu and ul of the submenu) need a div to encapsulate them,
but the component does not support this
At present, I cannot achieve satisfactory results in the add method of JqxNavigationBar, some events bound to ul menu
Because the mainstream way is v-for to generate itemsSeptember 28, 2020 at 12:31 pm How to dynamically generate nodes in the NavigationBar component #113179Hello JenkeNg,
Thank you for the feedback!
Best Regards,
MartinjQWidgets Team
https://www.jqwidgets.com/October 13, 2020 at 9:48 am How to dynamically generate nodes in the NavigationBar component #113292When will the improvement of “merging nodes into one root” be realized?
October 15, 2020 at 2:16 pm How to dynamically generate nodes in the NavigationBar component #113326Hello JenkeNg,
We do not think that the navigation bar violates any rules. If you wish you can put it inside a DIV tag and it is absolutely OK.
Best regards,
Peter StoevjQWidgets Team
https://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.