sweetalert

Pass HTML code as text of sweet alert

北城余情 提交于 2020-07-20 17:31:20
问题 I am using this in my application. I would like to use sweet alert like below. swal({ title: "Are you sure?", text: "You are going to delete <b>"+ name +"</b> address. ", icon: "warning", buttons: true, dangerMode: true, }) But it now working. It is displaying HTML code. Thanks. Update I read this question, but this question is about sweet alert2. My question is about sweet alert . Both are sweet alert but both are not same. 回答1: As @Elnoor has mentioned you can try to use html, but I had a

SweetAlert - Change Modal Width?

被刻印的时光 ゝ 提交于 2020-07-17 03:29:17
问题 I love this library. I'd like to use it to display a moderate response table on one of my web pages, but the text gets a little wide. I was hoping there was an option to change the width of the overall alert for the page that I'm displaying the table within SweetAlert, but I'm not having any luck. Table & HTML look great, just too much info for the modal. I can't even find where the width is set in the overall sweetalert.css. I thought maybe the customClass configuation key might help and I

SweetAlert - Change Modal Width?

為{幸葍}努か 提交于 2020-07-17 03:28:51
问题 I love this library. I'd like to use it to display a moderate response table on one of my web pages, but the text gets a little wide. I was hoping there was an option to change the width of the overall alert for the page that I'm displaying the table within SweetAlert, but I'm not having any luck. Table & HTML look great, just too much info for the modal. I can't even find where the width is set in the overall sweetalert.css. I thought maybe the customClass configuation key might help and I

SweetAlert - Change Modal Width?

一个人想着一个人 提交于 2020-07-17 03:28:22
问题 I love this library. I'd like to use it to display a moderate response table on one of my web pages, but the text gets a little wide. I was hoping there was an option to change the width of the overall alert for the page that I'm displaying the table within SweetAlert, but I'm not having any luck. Table & HTML look great, just too much info for the modal. I can't even find where the width is set in the overall sweetalert.css. I thought maybe the customClass configuation key might help and I

sweetalert_1.default is not a function : Angular 5

那年仲夏 提交于 2020-06-17 00:50:33
问题 I'm about discovering SweetAlert in the official link , so i wanted to use it in my app angular5 . i have installed it this way : npm install sweetalert --save I have imported it in my component : edit-client.component with this : import swal from 'sweetalert'; Here is the file editClient.component.ts where i tried to use it : import swal from 'sweetalert'; Component({ selector: 'app-edit-clients', templateUrl: './edit-clients.component.html', styleUrls: ['./edit-clients.component.scss'] })

How to add textarea tag as input element in sweet alert using jQuery

∥☆過路亽.° 提交于 2020-06-10 03:40:33
问题 I don't understand how to add a textarea type in sweet alert. Similar to type: "input" $('#saveBtn).click(function(){ swal({ title: "Enter your Name!", text: "your name:", type: "input", showCancelButton: true, closeOnConfirm: false, showLoaderOnConfirm: true, animation: "slide-from-top", inputPlaceholder: "Write something" }, function(inputValue){ if (inputValue === false) return false; if (inputValue === "") { swal.showInputError("You need to write something!"); return false } swal("Nice!",

sweetalert2 multiple swal at the same function

亡梦爱人 提交于 2020-05-13 19:27:03
问题 I'd like to make a condition and call a swal for each one (Sweetalert2). But only one of the swal runs. How can I do it? function validateEmail(email) { var regex = /\S+@\S+\.\S+/; return regex.test(email); } function validateBirth(data) { var regex = /^([0-9]{2})\/([0-9]{2})\/([0-9]{4})$/; return regex.test(data); } function validacao() { var data = document.getElementById('birth').value; var email = document.getElementById('email').value; if (!validateBirth(data)) { swal( 'title..', 'text..

sweetalert2 multiple swal at the same function

南楼画角 提交于 2020-05-13 19:25:05
问题 I'd like to make a condition and call a swal for each one (Sweetalert2). But only one of the swal runs. How can I do it? function validateEmail(email) { var regex = /\S+@\S+\.\S+/; return regex.test(email); } function validateBirth(data) { var regex = /^([0-9]{2})\/([0-9]{2})\/([0-9]{4})$/; return regex.test(data); } function validacao() { var data = document.getElementById('birth').value; var email = document.getElementById('email').value; if (!validateBirth(data)) { swal( 'title..', 'text..

Django批量插入数据和分页器

末鹿安然 提交于 2020-05-07 21:40:58
[TOC] 一、ajax结合sweetalert实现删除按钮动态效果 可以将sweetalert动态效果绑定在按钮的js事件上。可以使alert触发框好看一点。 当ajax需要对数据进行修改时,可以通过alert框进行确认。 // 可以在我的github上复制 $('.del').click(function () { let $btn = $(this); swal({ title: "确定要删除这条数据吗?", text: "删了就真没了!就得跑路了!!", type: "warning", showCancelButton: true, confirmButtonClass: "btn-danger", confirmButtonText: "确认删除!", cancelButtonText: "取消!", closeOnConfirm: false, closeOnCancel: false, showLoaderOnConfirm: true // 等待后端处理时间 。。。动画 }, function (isConfirm) { if (isConfirm) { $.ajax({ url:'', type:'post', data:{'delete_id':$btn.attr('userId')}, success:function (data) { if (data

SweetAlert - Change Color of Button

生来就可爱ヽ(ⅴ<●) 提交于 2020-03-18 03:38:10
问题 I'm trying to change the color of the cancel button like I can for the confirm button but it doesn't seem to work for some reason. swal({ title: "Are you sure?", text: "You will not be able to recover this imaginary file!", type: "warning", showCancelButton: true, cancelButtonColor: "#DD6B55", confirmButtonColor: "#DD6B55", confirmButtonText: "Yes, delete it!", cancelButtonText: "No, cancel please!", closeOnConfirm: false, closeOnCancel: false }, function (isConfirm) { if (isConfirm) { swal(