SweetAlert – Change Color of Button

You are using this version of SweetAlert: https://github.com/t4t5/sweetalert and in the source JS file (https://t4t5.github.io/sweetalert/dist/sweetalert-dev.js), there is no such parameter to change color of cancel button. In the file you have used, the params are: var defaultParams = { title: ”, text: ”, type: null, allowOutsideClick: false, showConfirmButton: true, showCancelButton: false, closeOnConfirm: true, closeOnCancel: true, … Read more

How to redirect page after click on Ok button on sweet alert?

Just make use of JavaScript promises. Put the then method after swal function. We do not need to use timer features. For example: swal({ title: “Wow!”, text: “Message!”, type: “success” }).then(function() { window.location = “redirectURL”; }); The promise method .then is used to wait until the user reads the information of modal window and decide … Read more

Remove “OK” button from sweet alert dialog

You can use these properties: showCancelButton: false, // There won’t be any cancel button showConfirmButton: false // There won’t be any confirm button Like This swal({ title: ‘Auto close alert!’, text: ‘I will close in 2 seconds.’, timer: 2000, showCancelButton: false, showConfirmButton: false }).then( function () {}, // handling the promise rejection function (dismiss) { … Read more

SweetAlert – Change Modal Width?

try to put !important like this in the css: .swal-wide{ width:850px !important; } See it working in the snippet. function TestSweetAlert(){ swal({ title: 1 +’ Issues for test’, text: “A custom <span style=”color:red;”>html</span> message.”, html: true, type: “info”, customClass: ‘swal-wide’, showCancelButton: true, showConfirmButton:false }); }; $(‘#testeSWAL’).on(“click”,TestSweetAlert); .swal-wide{ width:850px !important; } <script src=”https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js”></script> <script src=”https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js”></script> <link … Read more

Cannot flush updates when React is already rendering

{saveLabelFetchError && this.toggleAlertFailure(saveLabelFetchError)} You are trying to update the dom before render cycle i.e before component has mounted. hence, you are getting an error. Ideally, you should avoid using any library that mutates dom directly (not via react APIs) with react lib. You can read more from here The solution is to check if there … Read more

sweet-alert display HTML code in text

The SweetAlert repo seems to be unmaintained. There’s a bunch of Pull Requests without any replies, the last merged pull request was on Nov 9, 2014. I created SweetAlert2 with HTML support in modal and some other options for customization modal window – width, padding, Esc button behavior, etc. Swal.fire({ title: “<i>Title</i>”, html: “Testno sporocilo … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)