asp.net mvc - Kendo Panelbar MVC - Trying to Open Popup by clicking on a menu item -


in program have kendo panel bar shows menu, want open dialog box/ popup window when user clicks on menu child item.

    <div>         @(html.kendo().panelbar()     .name("panelbar")     .expandmode(panelbarexpandmode.single)     .events(events => events         .select(@<text> reportcontroller.onselect </text>))     .items(panelbar =>     {         panelbar.add().text("test1")             .expanded(true)             .items(test1=>             {                 workers.add().text("sample1");                 workers.add().text("sample2");                 workers.add().text("sample3");             });          panelbar.add().text("test2")             .items(test2 =>             {                 clients.add().text("book1")                     .items(costings =>                     {                         costings.add().text("page1");                         costings.add().text("page2");                         costings.add().text("page3");                            });                  clients.add().text("book2");             });         panelbar.add().text("new page").enabled(false);     })         )     </div> <script type="text/javascript">     $(document)         .ready(function() {             reportcontroller.init("#panelbar");         }); </script> 

if user clicks on sample1 here should open popup window. new kendo controls, how can achieve this?

<!doctype html> <html> <head>     <base href="http://demos.telerik.com/kendo-ui/panelbar/events">     <style>         html {             font-size: 14px;             font-family: arial, helvetica, sans-serif;         }     </style>     <title></title>     <link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.2.714/styles/kendo.common-material.min.css" />     <link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.2.714/styles/kendo.material.min.css" />     <link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.2.714/styles/kendo.default.mobile.min.css" />      <script src="//kendo.cdn.telerik.com/2016.2.714/js/jquery.min.js"></script>     <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js"></script>     <script src="//kendo.cdn.telerik.com/2016.2.714/js/kendo.all.min.js"></script>     <link rel="stylesheet" href="../content/shared/styles/examples-offline.css">     <script src="../content/shared/js/console.js"></script> </head> <body>      <div id="example">         <div class="demo-section k-content">             <ul id="panelbar">                 <li class="k-state-active">                     metallica - master of puppets 1986                     <ul>                         <li>battery</li>                         <li>master of puppets</li>                         <li>the thing 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 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 silent planet</li>                         <li>the thin line between love , hate</li>                     </ul>                 </li>                 <li>                     empty item                 </li>                 <li>                     ajax item                     <div></div>                 </li>                 <li>                     error item                     <div></div>                 </li>             </ul>         </div>         <div id="console" class="box" style="display:none">             <h4>console log</h4>             <div class="console"></div>         </div>     </div>     <script>         $(function () {             $("#console").dialog({                 autoopen: false,                 show: {                     effect: "blind",                     duration: 1000                 },                 hide: {                     effect: "explode",                     duration: 1000                 }             });         });          function onselect(e) {             var thedialog = $("#console").dialog("open");             thedialog.dialog("open");              kendoconsole.log("select: " + $(e.item).find("> .k-link").text());         }          function onexpand(e) {             kendoconsole.log("expand: " + $(e.item).find("> .k-link").text());         }          function oncollapse(e) {             kendoconsole.log("collapse: " + $(e.item).find("> .k-link").text());         }          function onactivate(e) {             kendoconsole.log("activate: " + $(e.item).find("> .k-link").text());         }          function oncontentload(e) {             kendoconsole.log("content loaded in <b>" + $(e.item).find("> .k-link").text() +                              "</b> , starts <b>" + $(e.contentelement).text().substr(0, 20) + "...</b>");         }          function onerror(e) {             kendoconsole.error("loading failed " + e.xhr.statustext + " " + e.xhr.status);         }          $("#panelbar").kendopanelbar({             expandmode: "single",             select: onselect,             expand: onexpand,             collapse: oncollapse,             activate: onactivate,             contentload: oncontentload,             error: onerror,             contenturls: [, , , "../content/web/panelbar/ajax/ajaxcontent1.html", "error.html"]         });     </script>  </body> </html> 

in above example, can observe in onselect event , have opened div dialog(model), have intialised in above function.

hope helps.. !!


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -