All Components

PanelBar / MVVM

Select an item

  • Metallica - Master of Puppets 1986
    • Battery
    • Master of Puppets
    • The Thing That Should Not Be
    • Welcome Home (Sanitarium)
    • Disposable Heroes
    • Leper Messiah
    • Orion (Instrumental)
    • Damage, Inc.
  • Iron Maiden - Brave New World 2000
    • The Wicker Man
    • Ghost Of The Navigator
    • Brave New World
    • Blood Brothers
    • The Mercenary
    • Dream Of Mirrors
    • The Fallen Angel
    • The Nomad
    • Out Of The Silent Planet
    • The Thin Line Between Love And Hate

Console

Configuration

Information

Kendo UI PanelBar supports the events and visible bindings.

HTML5/JavaScript 源码

<!DOCTYPE html>
<html>
 <head> 
  <title>MVVM</title> 
  <meta charset="utf-8"> 
  <link href="../content/shared/styles/examples-offline.css" rel="stylesheet"> 
  <link href="../../styles/kendo.common.min.css" rel="stylesheet"> 
  <link href="../../styles/kendo.rtl.min.css" rel="stylesheet"> 
  <link href="../../styles/kendo.default.min.css" rel="stylesheet"> 
  <link href="../../styles/kendo.dataviz.min.css" rel="stylesheet"> 
  <link href="../../styles/kendo.dataviz.default.min.css" rel="stylesheet"> 
  <script src="../../js/jquery.min.js"></script> 
  <script src="../../js/kendo.all.min.js"></script> 
  <script src="../content/shared/js/console.js"></script> 
  <script>
        
    </script> 
 </head> 
 <body> 
  <a class="offline-button" href="../index.html">Back</a> 
  <div id="example"> 
   <div class="demo-section k-content"> 
    <div> 
     <h4>Select an item</h4> 
     <ul data-role="panelbar" data-bind="events: { select: onSelect },
                           visible: isVisible"> 
      <li class="k-state-active"> Metallica - Master of Puppets 1986 
       <ul> 
        <li>Battery</li> 
        <li>Master of Puppets</li> 
        <li>The Thing That Should Not Be</li> 
        <li>Welcome Home (Sanitarium)</li> 
        <li>Disposable Heroes</li> 
        <li>Leper Messiah</li> 
        <li>Orion (Instrumental)</li> 
        <li>Damage, Inc.</li> 
       </ul> </li> 
      <li> Iron Maiden - Brave New World 2000 
       <ul> 
        <li>The Wicker Man</li> 
        <li>Ghost Of The Navigator</li> 
        <li>Brave New World</li> 
        <li>Blood Brothers</li> 
        <li>The Mercenary</li> 
        <li>Dream Of Mirrors</li> 
        <li>The Fallen Angel</li> 
        <li>The Nomad</li> 
        <li>Out Of The Silent Planet</li> 
        <li>The Thin Line Between Love And Hate</li> 
       </ul> </li> 
     </ul> 
    </div> 
    <div style="padding-top: 2em;"> 
     <h4>Console</h4> 
     <div class="console"></div> 
    </div> 
   </div> 
   <div class="box"> 
    <div class="box-col"> 
     <h4>Configuration</h4> 
     <div> 
      <label><input type="checkbox" data-bind="checked: isVisible">Visible</label> 
     </div> 
    </div> 
    <div class="box-col"> 
     <h4>Information</h4> Kendo UI PanelBar supports the 
     <a href="http://docs.telerik.com/kendo-ui/getting-started/framework/mvvm/bindings/events">events</a> and 
     <a href="http://docs.telerik.com/kendo-ui/getting-started/framework/mvvm/bindings/visible">visible</a> bindings. 
    </div> 
   </div> 
   <script>
    var viewModel = kendo.observable({
        isVisible: true,
        onSelect: function(e) {
            var text = $(e.item).children(".k-link").text();
            kendoConsole.log("event :: select(" + text + ")");
        }
    });
    kendo.bind($("#example"), viewModel);
</script> 
  </div>   
 </body>
</html>