繁体   English   中英

带有关闭按钮的Kendo Tabstrip选项卡

[英]Kendo Tabstrip tab with close button

我有一个带有关闭按钮的剑道标签。 问题是我无法获得按钮单击事件来关闭该选项卡。

 @(Html.Kendo().TabStrip()
  .Name("test")
  .Items(tabstrip =>
  {
     tabstrip.Add().Text("")
     .Selected(true)
     .ContentHtmlAttributes(new { style = "overflow: auto;" })
     .Content("");
  })
  .SelectedIndex(0)
  )

<script>
  tab.append({
    text: "" + name + " <input type='button' id='ddddd'>X</input> ",
    contentUrl: content,
    encoded: false
    //imageUrl: "/Images/close.png" <span class='tabdelete k-button'><span class=' k-icon k-i-close' ></span></span>
   })

 $("#ddddd").click(function () {
    alert("done");
 });
</script>

您的要求是这样吗? http://jsfiddle.net/palanikumar/8jf2wpng/

$('.cls-btn').click(function()
{
    var index = $(this).parent().parent().index();
    var tabStrip = $('#tabstrip').getKendoTabStrip();
    tabStrip.remove(index);
    tabStrip.select(0);
});

尝试这个

<input type='button' class="button" id='ddddd'>X</input>


   <script type="text/javascript">
        $(function(){
             //replace your selector if u need ID
              //$('body').on('click', '#buttonID', function () {
            $('body').on('click', '.button', function () {

                alert('ddsda');
            });
        });
        </script>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM