Thursday, January 29, 2015

BOOTSTRAP : HOW TO SHOW BOOTSTRAP CONFIRMATION DIALOGUE

JSP 
<html lang="en">

<head>
<script src="${pageContext.request.contextPath}/jquery/jquery.js"></script>
<script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap.js"></script>
<script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap-tooltip.js"></script>

<script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap-confirmation.js"></script>
</head>
<body>

<a class="btn" data-href="/pkg/Pkg/delete?                                             
                    pkgId=${pkgData.id}&pkgName=${pkgData.name}" 
                    data-toggle="confirmation" 
                    data-placement="left" 
                    data-popout="true" 
                    data-singleton="true" 
                    data-original-title="" title="">

<img src="${pageContext.request.contextPath}/images/delete.jpg"  />
</a>
</body>
</html>

JAVA SCRIPT
$(document).ready(function() {

$('[data-toggle="confirmation"]').confirmation({
title : 'Are you sure ?',
animation : true,
popout: true,
btnOkLabel : 'Yes',
btnCancelLabel : 'No',
onConfirm : function() {
},
onCancel : function() {
$('[data-toggle="confirmation"]').confirmation('hide');
}

});
});

No comments:

Post a Comment

Scrum and Scrum master

Scrum  Scrum is a framework which helps a team to work together.  It is like a rugby team (the scrum name comes from rugby game). Scrum enco...