sweetalert

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

大城市里の小女人 提交于 2019-12-31 01:56:48
问题 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' => [

Javascript - Uncaught (in promise)

こ雲淡風輕ζ 提交于 2019-12-25 09:16:13
问题 I have a function on click for which I use sweetalert2. This is the function: publish = function (article) { swal({ title: "Skal du publisere?", text: null, type: "info", showCancelButton: true, cancelButtonText: "Avbyrt", cancelButtonColor: '#FFF', confirmButtonColor: "#2E112D", confirmButtonText: "Ja, publisere" }).then(function(){ var articleId = $(article).val(); $.post("/admin/articles/publish/article", { '_token' : $('meta[name="csrf-token"]').attr('content'), 'articleId': articleId })

sweetalert blocking like normal prompt

妖精的绣舞 提交于 2019-12-24 21:14:03
问题 I am using swal (http://t4t5.github.io/sweetalert) to get some data from the user when they click on something. I want to then return that from the function I am calling swal in. In other words, for the example below, I want to set the text of the items in labels to the input value. The problem is it seems to return before swal has been closed/data has been entered: .on('dblclick', function(l) { labels.text(function (e) { return swal({ title: "Edit label" }, function(inputValue){ if

How to show sweetAlert Validation Delete Dialog in ASP MVC

会有一股神秘感。 提交于 2019-12-24 11:39:08
问题 I am developing an ASP MVC 5 web application using SQL Server. I am trying to delete a profile (client in database) via a button with javascript function. Clicking on the button, the profile is deleted but the validation dialog doesn't appear. I don't know what the reason is but I doubt that there is an issue with the javascript code. I tried also to create another button without submit, in order to verify the sweetAlert process. And it worked well. This is my View : @using (Html.BeginForm(

How to Focus on textinput field in alert combined with modaldialog in R?

时光毁灭记忆、已成空白 提交于 2019-12-24 08:47:29
问题 I am building a Shiny app in which a user can open a modalDialog by clicking on points in a plot. The modalDialog contains a plot of the raw data behind the point clicked. The user is presented an actionButton linked to code to save the detailed plot in the modalDialog with a sweetalert swal message with an inputfield . The problem is that bootstrap forces focus on the modalDialog , causing the inputfield to be blocked from use for typing. I have seen some javascipt online that should

How to call method i sweetalert 2

老子叫甜甜 提交于 2019-12-24 08:16:24
问题 In my angular 4 project I am using a theme with sweetalert 2, I want to call my method when user click on the confirm button, but it seems that I can't call any method inside then function 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 () { // I want to call my method here but I can't do this.myMethod() }) I know It

echo with sweetalert not working

自作多情 提交于 2019-12-24 03:05:55
问题 I am trying to echo a alert/notification box. This one is working fine - echo '<script language="javascript">'; echo 'alert("Record successfully added in database")'; echo '</script>'; But I want to give timing for disappear the box after 2 seconds. I have no idea how to do it. I found through sweetalert it is possible. So I did like this - echo '<script src="sweetalert/lib/sweet-alert.min.js">'; echo '<link rel="stylesheet" type="text/css" href="sweetalert/lib/sweet-alert.css">'; echo 'swal(

echo with sweetalert not working

谁说我不能喝 提交于 2019-12-24 03:05:25
问题 I am trying to echo a alert/notification box. This one is working fine - echo '<script language="javascript">'; echo 'alert("Record successfully added in database")'; echo '</script>'; But I want to give timing for disappear the box after 2 seconds. I have no idea how to do it. I found through sweetalert it is possible. So I did like this - echo '<script src="sweetalert/lib/sweet-alert.min.js">'; echo '<link rel="stylesheet" type="text/css" href="sweetalert/lib/sweet-alert.css">'; echo 'swal(

How to run a SweetAlert instead of default javascript confirm method

让人想犯罪 __ 提交于 2019-12-21 17:04:51
问题 Currently this is the code I use to run a normal confirm window based on the class "confirmation". This is all done with an href link and not on a button onClick event. As the result of the click is to run another code snipped placed in a different file (with the intention to delete a row in db). $('.confirmation').on('click', function () { return confirm('Er du sikker på at du vil slette?'); }); What I want is to replace the confirm method with this SweetAlert function swal({ title: "Are you

Page is not waiting for response from SweetAlert confirmation window

微笑、不失礼 提交于 2019-12-21 09:07:25
问题 I am trying to upgrade my JavaScript confirm() action to use SweetAlert. Currently my code is something like this: <a href="/delete.php?id=100" onClick="return confirm('Are you sure ?');" >Delete</a> This waits for the user to confirm before navigating to the delete page. I would like to use this example from SweetAlert to ask the user to confirm before deleting: swal({ title: "Are you sure?", text: "You will not be able to recover this imaginary file!", type: "warning", showCancelButton: