Se7en template use in bootstrap style (1) Operation prompt information box

js is referenced in the code

<!-- Prompt message start-->

<script src="<%=basePath%>static/javascripts/sweetalert-dev.js" type="text/javascript"></script>

<!-- prompt message end-->

Code example in the actual project:


	 function delRow(id){
                  title: "Are you sure you want to delete?",
                  text: "Are you sure you want to delete this data?",
                  type: "warning",
                  showCancelButton: true,
                  closeOnConfirm: false,
                  animation: "slide-from-top",
                  cancelButtonText: "Cancel",
                  confirmButtonText: "Yes, I want to delete",
                  confirmButtonColor: "#ec6c62"
              }, function() {
              			 {Id:  id},
              			function(datas, status){
              				if(datas.errorCode ==0){//Success
              					if( >0){
              						var count =[0].count;
              						 // swal("Successful operation!", "Deleted successfully: "+count+" pieces of data!", "success");
             		                       title: "Operation successful!",
             		                       text: "Deleted successfully: "+count+" pieces of data!",
             		                       animation: "slide-from-top",
             		                       type: "success",
             		                       html: true,
             		                       timer: 3000
              					swal("warning", "Delete operation failed!", "error");
              			function( textStatus, errorThrown){}); 	

 swal API method


parameter describe Defaults
title Tooltip title -
text Tips -
type Prompt type, there are: success (success), error (error), warning (warning), input (input). -
showCancelButton Whether to show the "Cancel" button.  Set Chinese name: cancelButtonText: "Cancel", -
animation The animation effect when the prompt box pops up, such as slide-from-top (slide down from the top), etc. -
html Whether to support html content. -
timer Set the time (milliseconds) to automatically close the prompt box. -
showConfirmButton Whether to display the OK button. -
confirmButtonText Defines the text content of the OK button. -
imageUrl Define the image address in the popup box.

Need to leave a message to communicate


Guess you like