用户单击是POPOVER CONFIRMATION时删除数据

时间:2017-05-04 12:33:03

标签: javascript jquery twitter-bootstrap bootstrap-popover

我正在使用Bootstrap插件使用Popover进行就地确认框。我想在用户单击是按钮时删除记录。我怎样才能做到这一点? link用于Bootstrap插件

  • Bəli-means yes
  • Eminsen? - 你确定吗?
  • SİL - 删除

我的按钮

  <a href="#" id="@applicant.Id"  class="btn btn-outline purple-sharp  uppercase" data-btn-ok-label="Bəli"  data-toggle="confirmation"  data-placement="right" data-original-title="" title="Are you sure?" aria-describedby="confirmation64993">

                                    <i class="fa fa-trash" ></i> Delete
                                </a>

enter image description here

1 个答案:

答案 0 :(得分:3)

<a href="#" id="@applicant.Id"  class="btn btn-outline purple-sharp  uppercase delete-confirmation" data-btn-ok-label="Bəli"  data-toggle="confirmation"  data-placement="right" data-original-title="" title="Are you sure?" aria-describedby="confirmation64993">

      <i class="fa fa-trash" ></i> Delete
</a>

// You should replace the deleteElement() function with your code
<script>
    $('.delete-confirmation').confirmation({
         onConfirm: function(event) {
              deleteElement();
         }      
    });
</script>