dataSource

A DataSource instance of configuration dictionary, to define the data for the SplitButton's context menu.

Each menu item is represented by a dictionary, containing the following items:

  • content - the menu item title
  • cls - optional css class for the menu item
  • href - optional URL to redirect to when menu item is clicked
  • disabled - optional flag indicating that the menu item is disabled
  • separator - optional separator flag
  • iconUrl - optional URL for a menu item's icon
  • iconCls - optional class for a menu item's icon

A short example is shown below.

<button id="but1">Click me</button>

<script type="text/javascript">
     $(function () {
        $("#but1").shieldSplitButton({
            dataSource: {
                data: [
                    { content: "Menu Item One" },
                    { content: "Second Menu Item" },
                    { separator: true },
                    { content: "Last Item", href: "/exit.html" }
                ]
            }
        });
     });
</script>