[]
        
(Showing Draft Content)

wjMenuItem Class

wjMenuItem Class

KnockoutJS binding for menu items.

Use the wjMenuItem binding to add menu items to a Menu control. The wjMenuItem binding must be contained in a wjMenu binding. For example:

<p>Here is a Menu control with four menu items:</p>
<div data-bind="wjMenu: { value: tax, header: 'Tax' }">
    <span data-bind="wjMenuItem: { value: 0 }">Exempt</span>
    <span data-bind="wjMenuItem: { value: .05 }">5%</span>
    <span data-bind="wjMenuItem: { value: .1 }">10%</span>
    <span data-bind="wjMenuItem: { value: .15 }">15%</span>
</div>

The wjMenuItem binding supports the following attributes:

cmd
Function to execute in the controller when the item is clicked.
cmdParam
Parameter passed to the cmd function when the item is clicked.
value
Value selected when the item is clicked (use either this or cmd).

Heirarchy

  • WjBinding
    • wjMenuItem