Vue UI Components Documentation
Vue ListMenu Component
The ListMenu component for Vue represents a collection of Unordered and Ordered Lists. By nesting child UL or OL inside list items, you can create nested lists.
Prerequisites
Refer to Vue Getting Started before you start with this help topic.
Configuration
After you have created your App.vue file, here is how you should structure it:
The ListMenu component for Vue requires the following import:
Add the jqxListMenu component to the components section of the the Vue class:
Template
The App.vue has a <template>
structural tag where we determine the application structure.
There we will also set the tags for the new components - <JqxListMenu/>
<template> <JqxListMenu :enableScrolling="enableScrolling" :showHeader="showHeader" :showBackButton="showBackButton" :showFilter="showFilter" :width="width"> <ul data-role="listmenu"> <li> OSI <ul data-role="listmenu"> <li> Application Layer <ol data-role="listmenu"> <li>SIP</li> <li>DNS</li> <li>FTP</li> <li>RTP</li> <li>DHCP</li> </ol> </li> <li> Presentation Layer <ol data-role="listmenu"> <li>SSL</li> <li>TLS</li> </ol> </li> <li> Session Layer <ol data-role="listmenu"> <li>NetBIOS</li> <li>SPDY</li> </ol> </li> <li> Transport Layer <ol data-role="listmenu"> <li>TCP</li> <li>UDP</li> <li>SCTP</li> </ol> </li> <li> Network Layer <ol data-role="listmenu"> <li>IP</li> <li>ARP</li> <li>ICMP</li> </ol> </li> <li> Data Link Layer <ol data-role="listmenu"> <li>ATM</li> <li>SDLS</li> <li>LLC</li> </ol> </li> <li> Physical Layer <ol data-role="listmenu"> <li>EIA/TIA-232</li> <li>ITU-T V-Series</li> <li>DSL</li> </ol> </li> </ul> </li> <li> TCP/IP <ul data-role="listmenu"> <li> Application layer <ol data-role="listmenu"> <li>DHCP</li> <li>DNS</li> <li>FTP</li> <li>HTTP</li> <li>IMAP</li> <li>LDAP</li> <li>XMPP</li> <li>SSH</li> <li>RIP</li> </ol> </li> <li> Transport layer <ol data-role="listmenu"> <li>TCP</li> <li>UDP</li> <li>SCTP</li> </ol> </li> <li> Internet layer <ol data-role="listmenu"> <li>IP</li> <li>ICMP</li> <li>ECN</li> </ol> </li> <li> Link layer <ol data-role="listmenu"> <li>ARP</li> <li>NDP</li> <li>DSL</li> </ol> </li> </ul> </li> </ul> </JqxListMenu></template>
Properties
The properties of the <JqxListMenu/> component are defined in the data
member of the Vue class.
We should put them in the return object of the data function:
data: function () { return { enableScrolling: false, showHeader: true, showBackButton: true, showFilter: false, width: '50%' }}
Methods
To use a component's method we should have its reference. In Vue we refer to a component by the special $refs
property.
Before that we need to add the desired name reference to that component:
<JqxListMenu ref="listmenu"></JqxListMenu>
Here how you can use a component's method:
this.$refs.listmenu.changePage();
methods: { // Add here all used callbacks and/or events gotoPage: function (page) { // Do something... this.$refs.listmenu.changePage(page); }}
If we want to add additional methods we should also implement them in the methods
member.
In case we need to do some precalculation or something else before the components are rendered, we should use the beforeCreate
member.
It depends on the case.
If you have followed the above steps, you App.vue file would look like this:
App.vue:
<template> <JqxListMenu ref="listmenu" :enableScrolling="enableScrolling" :showHeader="showHeader" :showBackButton="showBackButton" :showFilter="showFilter" :width="width"> <ul data-role="listmenu"> <li> OSI <ul data-role="listmenu"> <li> Application Layer <ol data-role="listmenu"> <li>SIP</li> <li>DNS</li> <li>FTP</li> <li>RTP</li> <li>DHCP</li> </ol> </li> <li> Presentation Layer <ol data-role="listmenu"> <li>SSL</li> <li>TLS</li> </ol> </li> <li> Session Layer <ol data-role="listmenu"> <li>NetBIOS</li> <li>SPDY</li> </ol> </li> <li> Transport Layer <ol data-role="listmenu"> <li>TCP</li> <li>UDP</li> <li>SCTP</li> </ol> </li> <li> Network Layer <ol data-role="listmenu"> <li>IP</li> <li>ARP</li> <li>ICMP</li> </ol> </li> <li> Data Link Layer <ol data-role="listmenu"> <li>ATM</li> <li>SDLS</li> <li>LLC</li> </ol> </li> <li> Physical Layer <ol data-role="listmenu"> <li>EIA/TIA-232</li> <li>ITU-T V-Series</li> <li>DSL</li> </ol> </li> </ul> </li> <li> TCP/IP <ul data-role="listmenu"> <li> Application layer <ol data-role="listmenu"> <li>DHCP</li> <li>DNS</li> <li>FTP</li> <li>HTTP</li> <li>IMAP</li> <li>LDAP</li> <li>XMPP</li> <li>SSH</li> <li>RIP</li> </ol> </li> <li> Transport layer <ol data-role="listmenu"> <li>TCP</li> <li>UDP</li> <li>SCTP</li> </ol> </li> <li> Internet layer <ol data-role="listmenu"> <li>IP</li> <li>ICMP</li> <li>ECN</li> </ol> </li> <li> Link layer <ol data-role="listmenu"> <li>ARP</li> <li>NDP</li> <li>DSL</li> </ol> </li> </ul> </li> </ul> </JqxListMenu></template> <script> // Import the components that will be used import JqxListMenu from "jqwidgets-scripts/jqwidgets-vue/vue_jqxlistmenu.vue"; export default { components: { // Adding imported widgets here JqxListMenu }, data: function () { // Define properties which will use in the widget return { enableScrolling: false, showHeader: true, showBackButton: true, showFilter: false, width: '50%' } }, beforeCreate: function () { // Add here any data where you want to transform before components be rendered }, methods: { // Add here all used callbacks and/or events gotoPage: function (page) { // Do something... this.$refs.listmenu.changePage(page); } } }</script> <style></style>
ListMenu Example
<template> <JqxListMenu :autoSeparators="true" :enableScrolling="false" :showHeader="true" :placeHolder="'Find contact...'" :width="600"> <ul data-role="listmenu"> <li> <img src="images/andrew.png" alt="" /><div> Andrew Fuller </div> <ul data-role="listmenu"> <li> <div style="padding: 5px;" data-role="content"> <table> <tr> <td> <img width="50" height="50" src="images/andrew.png" alt="" /> </td> <td> <b>Andrew Fuller</b> </td> </tr> <tr> <td> Title </td> <td> Sales Representative </td> </tr> <tr> <td> Notes </td> <td> "Andrew received his BTS commercial in 1974 and a Ph.D. in international marketing from the University of Dallas in 1981. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager in January 1992 and to vice president of sales in March 1993. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association. </td> </tr> <tr> <td> Birth Date </td> <td> 19-Feb-52 </td> </tr> <tr> <td> Hire Date </td> <td> 14-Aug-92 </td> </tr> <tr> <td> Home Phone </td> <td> (206) 555-9482 </td> </tr> <tr> <td> Address </td> <td> 908 W. Capital Way. </td> </tr> <tr> <td> Postal Code </td> <td> 98401 </td> </tr> <tr> <td> City </td> <td> Tacoma </td> </tr> <tr> <td> Country </td> <td> USA </td> </tr> </table> </div> </li> </ul> </li> <li> <img src="images/anne.png" alt="" /><div> Anne Dodsworth </div> <ul data-role="listmenu"> <li> <div style="padding: 5px;" data-role="content"> <table> <tr> <td> <img width="50" height="50" src="images/anne.png" alt="" /> </td> <td> <b>Anne Dodsworth</b> </td> </tr> <tr> <td> Title </td> <td> Inside Sales Coordinator </td> </tr> <tr> <td> Notes </td> <td> Anne has a BA degree in English from St. Lawrence College. She is fluent in French and German. </td> </tr> <tr> <td> Birth Date </td> <td> 27-Jan-66 </td> </tr> <tr> <td> Hire Date </td> <td> 15-Nov-94 </td> </tr> <tr> <td> Home Phone </td> <td> (71) 555-5598 </td> </tr> <tr> <td> Address </td> <td> 7 Houndstooth Rd. </td> </tr> <tr> <td> Postal Code </td> <td> WG2 7LT </td> </tr> <tr> <td> City </td> <td> London </td> </tr> <tr> <td> Country </td> <td> UK </td> </tr> </table> </div> </li> </ul> </li> <li> <img src="images/janet.png" alt="" /><div> Janet Leverling </div> <ul data-role="listmenu"> <li> <div style="padding: 5px;" data-role="content"> <table> <tr> <td> <img width="50" height="50" src="images/janet.png" alt="" /> </td> <td> <b>Janet Leverling</b> </td> </tr> <tr> <td> Title </td> <td> Sales Representative </td> </tr> <tr> <td> Notes </td> <td> Janet has a BS degree in chemistry from Boston College (1984). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate in 1991 and promoted to sales representative in February 1992. </td> </tr> <tr> <td> Birth Date </td> <td> 27-Jan-69 </td> </tr> <tr> <td> Hire Date </td> <td> 15-Nov-94 </td> </tr> <tr> <td> Home Phone </td> <td> (71) 555-4444 </td> </tr> <tr> <td> Address </td> <td> Miner Rd. </td> </tr> <tr> <td> Postal Code </td> <td> WG2 7LT </td> </tr> <tr> <td> City </td> <td> London </td> </tr> <tr> <td> Country </td> <td> UK </td> </tr> </table> </div> </li> </ul> </li> <li> <img src="images/laura.png" alt="" /><div> Laura Callahan </div> <ul data-role="listmenu"> <li> <div style="padding: 5px;" data-role="content"> <table> <tr> <td> <img width="50" height="50" src="images/laura.png" alt="" /> </td> <td> <b>Laura Callahan</b> </td> </tr> <tr> <td> Title </td> <td> Sales Representative </td> </tr> <tr> <td> Notes </td> <td> Laura received a BA in psychology from the University of Washington. She has also completed a course in business French. She reads and writes French. </td> </tr> <tr> <td> Birth Date </td> <td> 27-Jan-66 </td> </tr> <tr> <td> Hire Date </td> <td> 15-Nov-94 </td> </tr> <tr> <td> Home Phone </td> <td> (71) 555-4444 </td> </tr> <tr> <td> Address </td> <td> 7 Houndstooth Rd. </td> </tr> <tr> <td> Postal Code </td> <td> WG2 7LT </td> </tr> <tr> <td> City </td> <td> London </td> </tr> <tr> <td> Country </td> <td> UK </td> </tr> </table> </div> </li> </ul> </li> <li> <img src="images/margaret.png" alt="" /><div> Margaret Peacock </div> <ul data-role="listmenu"> <li> <div style="padding: 5px;" data-role="content"> <table> <tr> <td> <img width="50" height="50" src="images/margaret.png" alt="" /> </td> <td> <b>Margaret Peacock</b> </td> </tr> <tr> <td> Title </td> <td> Vice President, Sales </td> </tr> <tr> <td> Notes </td> <td> Margaret holds a BA in English literature from Concordia College (1958) and an MA from the American Institute of Culinary Arts (1966). She was assigned to the London office temporarily from July through November 1992. </td> </tr> <tr> <td> Birth Date </td> <td> 19-Sep-37 </td> </tr> <tr> <td> Hire Date </td> <td> 17-Oct-93 </td> </tr> <tr> <td> Home Phone </td> <td> (206) 555-8122 </td> </tr> <tr> <td> Address </td> <td> 4110 Old Redmond Rd. </td> </tr> <tr> <td> Postal Code </td> <td> 98052 </td> </tr> <tr> <td> City </td> <td> Redmond </td> </tr> <tr> <td> Country </td> <td> USA </td> </tr> </table> </div> </li> </ul> </li> <li> <img src="images/michael.png" alt="" /><div> Michael Suyama </div> <ul data-role="listmenu"> <li> <div style="padding: 5px;" data-role="content"> <table> <tr> <td> <img width="50" height="50" src="images/michael.png" alt="" /> </td> <td> <b>Michael Suyama</b> </td> </tr> <tr> <td> Title </td> <td> Sales Representative </td> </tr> <tr> <td> Notes </td> <td> Michael is a graduate of Sussex University (MA, economics, 1983) and the University of California at Los Angeles (MBA, marketing, 1986). He has also taken the courses 'Multi-Cultural Selling' and 'Time Management for the Sales Professional.' He is fluent in Japanese and can read and write French, Portuguese, and Spanish. </td> </tr> <tr> <td> Birth Date </td> <td> 02-Jul-63 </td> </tr> <tr> <td> Hire Date </td> <td> 05-June-96 </td> </tr> <tr> <td> Home Phone </td> <td> (71) 555-4848 </td> </tr> <tr> <td> Address </td> <td> Coventry House </td> </tr> <tr> <td> Postal Code </td> <td> EC2 7JR </td> </tr> <tr> <td> City </td> <td> London </td> </tr> <tr> <td> Country </td> <td> UK </td> </tr> </table> </div> </li> </ul> </li> <li> <img src="images/nancy.png" alt="" /><div> Nancy Divolio </div> <ul data-role="listmenu"> <li> <div style="padding: 5px;" data-role="content"> <table> <tr> <td> <img width="50" height="50" src="images/nancy.png" alt="" /> </td> <td> <b>Nancy Davolio</b> </td> </tr> <tr> <td> Title </td> <td> Sales Representative </td> </tr> <tr> <td> Notes </td> <td> Education includes a BA in psychology from Colorado State University in 1970. She also completed 'The Art of the Cold Call.' Nancy is a member of Toastmasters International. </td> </tr> <tr> <td> Birth Date </td> <td> 08-Dec-48 </td> </tr> <tr> <td> Hire Date </td> <td> 01-May-92 </td> </tr> <tr> <td> Home Phone </td> <td> (206) 555-9857 </td> </tr> <tr> <td> Address </td> <td> 507 - 20th Ave. E. Apt. 2A </td> </tr> <tr> <td> Postal Code </td> <td> 98122 </td> </tr> <tr> <td> City </td> <td> Seattle </td> </tr> <tr> <td> Country </td> <td> USA </td> </tr> </table> </div> </li> </ul> </li> <li> <img src="images/robert.png" alt="" /><div> Robert King </div> <ul data-role="listmenu"> <li> <div style="padding: 5px;" data-role="content"> <table> <tr> <td> <img width="50" height="50" src="images/robert.png" alt="" /> </td> <td> <b>Robert King</b> </td> </tr> <tr> <td> Title </td> <td> Sales Representative </td> </tr> <tr> <td> Notes </td> <td> Robert King served in the Peace Corps and traveled extensively before completing his degree in English at the University of Michigan in 1992, the year he joined the company. After completing a course entitled 'Selling in Europe,' he was transferred to the London office in March 1993. </td> </tr> <tr> <td> Birth Date </td> <td> 29-May-60 </td> </tr> <tr> <td> Hire Date </td> <td> 02-Jan-94 </td> </tr> <tr> <td> Home Phone </td> <td> (71) 555-5598 </td> </tr> <tr> <td> Address </td> <td> Winchester Way </td> </tr> <tr> <td> Postal Code </td> <td> RG1 9SP </td> </tr> <tr> <td> City </td> <td> London </td> </tr> <tr> <td> Country </td> <td> UK </td> </tr> </table> </div> </li> </ul> </li> <li> <img src="images/steven.png" alt="" /><div> Steven Buchanan </div> <ul data-role="listmenu"> <li> <div style="padding: 5px;" data-role="content"> <table> <tr> <td> <img width="50" height="50" src="images/steven.png" alt="" /> </td> <td> <b>Steven Buchanan</b> </td> </tr> <tr> <td> Title </td> <td> Sales Manager </td> </tr> <tr> <td> Notes </td> <td> Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree in 1976. Upon joining the company as a sales representative in 1992, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London. He was promoted to sales manager in March 1993. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management.' He is fluent in French. </td> </tr> <tr> <td> Birth Date </td> <td> 04-Mar-55 </td> </tr> <tr> <td> Hire Date </td> <td> 02-May-94 </td> </tr> <tr> <td> Home Phone </td> <td> (71) 555-5598 </td> </tr> <tr> <td> Address </td> <td> 908 W. Capital Way </td> </tr> <tr> <td> Postal Code </td> <td> 98052 </td> </tr> <tr> <td> City </td> <td> Redmond </td> </tr> <tr> <td> Country </td> <td> USA </td> </tr> </table> </div> </li> </ul> </li> </ul> </JqxListMenu></template><script> import JqxListMenu from "jqwidgets-scripts/jqwidgets-vue/vue_jqxlistmenu.vue"; export default { components: { JqxListMenu } }</script> <style> html, body { width: 100vw; height: 100vh; padding: 0; margin: 0; } .jqx-listmenu-item-label img { width: 50px; height: 55px; } .jqx-listmenu-item-label div:not(.jqx-widget-content) { margin-top: -35px; margin-left: 80px; } .jqx-listmenu-item { background-color: white; padding: 0px; min-height: 57px; }</style>