JqxMenu: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
Line 12: Line 12:


<pre>
<pre>
Dim data, source, dataAdapter
Sub Main()
data = generatedata(50)     'generatedata is a function which returns grid data
  $("#Menu1").jqxMenu(Menu1_settings)
source = {localdata: data, datatype: "array"}
  $("#Menu2").jqxMenu(Menu2_settings)
dataAdapter = new $.jqx.dataAdapter(source)
End Sub
             
 
Grid1_settings.source = dataAdapter
Function Menu1_onitemclick(event)
Grid1_settings.columns = [ _
  menuItemText=$(event.target).text()
    { text: "First Name", dataField: "firstname", width: 100 }, _
  console.log(menuItemText)
     { text: "Last Name", dataField: "lastname", width: 100 }, _
End Function
     { text: "Product", dataField: "productname", width: 180 }, _
 
    { text: "Quantity", dataField: "quantity", width: 80, cellsalign: "right" }, _
source = [ _
    { text: "Unit Price", dataField: "price", width: 90, cellsalign: "right", cellsformat: "c2" }, _
  {label: "Home" }, _
    { text: "Total", dataField: "total", cellsalign: "right", minwidth: 100, cellsformat: "c2" } _
  {label: "Products", items: [ _
  ]
     {label: "Product A" }, _
     {label: "Product B" } ] _
  }, _
  {label: "Purchase" }, _
  {label: "Contact Us" }, _
  {label: "About Us"}]
 
Menu1_settings.source=source
Menu2_settings.source=source
</pre>
</pre>



Revision as of 21:35, 4 January 2013

Description

jqxMenu represents a jQuery menu widget that makes it easy to add menus to your app. With the jqxMenu you can create website menus, customized context menus, or application-style menu bars with just a small amount of scripting.

Properties and Methods

See the complete documentation at jqWidget's site: http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxmenu/jquery-menu-getting-started.htm

Example

Sub Main()
  $("#Menu1").jqxMenu(Menu1_settings)
  $("#Menu2").jqxMenu(Menu2_settings)
End Sub

Function Menu1_onitemclick(event)
  menuItemText=$(event.target).text()
  console.log(menuItemText)
End Function

source = [ _
  {label: "Home" }, _
  {label: "Products", items: [ _
    {label: "Product A" }, _
    {label: "Product B" } ] _
  }, _
  {label: "Purchase" }, _
  {label: "Contact Us" }, _
  {label: "About Us"}]

Menu1_settings.source=source
Menu2_settings.source=source

Output

See above.