sweetalert

How to use sweetalert2 in angular2

廉价感情. 提交于 2019-12-03 01:55:34
Getting this error after npm start in angular project. app/app.component.ts(12,7): error TS2304: Cannot find name 'swal'. app/app.component.ts(21,7): error TS2304: Cannot find name 'swal'. I created an angular project. Inside app.component.ts I added sweet alert code export class AppComponent { deleteRow() { swal({ title: 'Are you sure?', text: "You won't be able to revert this!", type: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Yes, delete it!' }).then(function() { swal( 'Deleted!', 'Your file has been deleted.', 'success'

sweet alert confirm dialog in asp.net

我的未来我决定 提交于 2019-12-02 14:37:45
问题 I am able to get the alerts for isConfirm both true and false in sweet alert but unable to pass the same to btnSave to call btnSave_Click method in codebehind. Please help. Using latest sweetalert, downloaded from http://t4t5.github.io/sweetalert/ . <script type="text/javascript"> $('body').on('focus', ".Datetext", function () { $(this).datepicker(); }); function Confirm(th, e) { e.preventDefault(); swal({ title: "Are you sure?", text: "You want to Save this project?", type: "warning",

Promise error in ASP.NET Boilerplate (Core 2.0 + Angular 5) Free Template

天大地大妈咪最大 提交于 2019-12-02 12:18:14
问题 I have been using ASP.NET Boilerplate to do CRUD Operations with the database with a REST API client like Postman using custom APIs and so far , it's working quite well. But then when I move on to the frontend part, there is an unhandled exception in Users Component after logging in with an Admin account. First of all, I can see the list of users that I added, from which I can say the Create and Get operations are running properly (I also tested editing the users and it worked well). When I

sweet alert confirm dialog in asp.net

隐身守侯 提交于 2019-12-02 10:34:17
I am able to get the alerts for isConfirm both true and false in sweet alert but unable to pass the same to btnSave to call btnSave_Click method in codebehind. Please help. Using latest sweetalert, downloaded from http://t4t5.github.io/sweetalert/ . <script type="text/javascript"> $('body').on('focus', ".Datetext", function () { $(this).datepicker(); }); function Confirm(th, e) { e.preventDefault(); swal({ title: "Are you sure?", text: "You want to Save this project?", type: "warning", showCancelButton: true, confirmButtonColor: '#DD6B55', confirmButtonText: 'Yes, I am sure!', cancelButtonText

Sweet Alert Pop up Prompt Before Downloading Canvas HTML Image to PNG

随声附和 提交于 2019-12-02 09:37:45
in my Canvas drawing app I have a download to png button, I want to make it so the image off the canvas only downloads when the user clicks "yes save it" on my sweet alert pop up prompt. Right now it's still downloading automatically. Thank you for your help. (also if someone had a better way to download via Javascript that would help too, it's downloading the png but it is corrupt and I can't open it) $('#download').click(function(){ swal({ title: "Are you finished your creation?", text: "click yes to save", type: "warning", showCancelButton: true, confirmButtonColor: "#f8c1D9",

Javascript Sweet Alert and html link inside text

痴心易碎 提交于 2019-12-02 05:36:44
i have the following SweetAlert Code.. <script type="text/javascript" charset="utf-8"> $('.patient-details').click(function(e) { e.preventDefault(); var name = $(this).attr('data-name'); var gender = $(this).attr('data-gender'); var age = $(this).attr('data-age'); var country = $(this).attr('data-country'); var state = $(this).attr('data-state'); var address = $(this).attr('data-address'); var report = $(this).attr('data-report'); swal({ title: name, text: "Gender: " + gender +"\n" + "Age: " + age +"\n" + "Country: " + country +"\n" + "State: " + state +"\n" + "Address: " + address +"\n" +

Promise error in ASP.NET Boilerplate (Core 2.0 + Angular 5) Free Template

大兔子大兔子 提交于 2019-12-02 04:53:45
I have been using ASP.NET Boilerplate to do CRUD Operations with the database with a REST API client like Postman using custom APIs and so far , it's working quite well. But then when I move on to the frontend part, there is an unhandled exception in Users Component after logging in with an Admin account. First of all, I can see the list of users that I added, from which I can say the Create and Get operations are running properly (I also tested editing the users and it worked well). When I get to " Deleting " the users, I can see an exception in the console output as shown in the picture: I

sweetalert 2 target a div rather than entire window?

和自甴很熟 提交于 2019-12-02 04:26:41
Is it possible to target a div rather than the entire window for SweetAlert2 ? If not is is possible to edit the center coordinates? The reason I ask is that I have a few JavaScript games that i would like to use this framework with. these are loaded in <div> 's which are not centered on the page. The sweet alert popup looks strange when it opens as it is miss-aligned. This is fine for mobile games but not for browser based. Any help would be great :) Here you go: Swal.fire({ title: 'I will be placed inside the #swal2-container', target: document.getElementById('swal2-container') }) <script

Stop the control while SweetAlert is on screen [duplicate]

荒凉一梦 提交于 2019-12-01 21:34:58
This question already has an answer here: How do I return the response from an asynchronous call? 36 answers I am using sweetalert2 library for showing alert in my code. ConfirmationMessage = function(msg) { swal({ title: "", text: msg, type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Ok", cancelButtonText: "Cancel", closeOnConfirm: false, closeOnCancel: false, allowEscapeKey: true }); } This is the JS function and I am using it at other place. if (!ConfirmationMessage("message to show.")) { alert("if"); } else { alert("else"); } My issue is I want to

Yii2: Replace default confirmation message used by Gridview with Sweet alert

♀尐吖头ヾ 提交于 2019-12-01 20:37:27
I am using yii2mod/yii2-sweet-alert in my projects, I am using it on basic and advanced themes, and I love it. The question. How can I change the grid default confirmation dialog that is a plain javascript confirmation in order to use Sweet-alert to make it look better? I already tried modifying the button's template for the delete, because if you want to change the message you will do the following: [ 'class' => ActionColumn::className(), 'template' => '{update}{delete}', 'buttons' => [ 'delete' => function($url, $model){ return Html::a('<span class="glyphicon glyphicon-trash"></span>', [