Freeman35 Posted June 26, 2018 Share Posted June 26, 2018 https://sweetalert2.github.io/ Current version: v7.24.2 dismiss event not triggered, AjaxRequest always "success" jsonSweetAlert := 'swal(' + jsonSweetAlert + ').then(function(){' + ajaxCallbackStr + ' return false; },function (dismiss) { '+ dismissCallbackStr + '});'; Anybody help about this problem? regards Fixed: dismissCallbackStr:= BuildAjaxRequest('dismiss'); jsonSweetAlert := 'swal(' + jsonSweetAlert + ').then((result)=>{if(result.value){'+ajaxCallbackStr +'}else{'+dismissCallbackStr +'}})'; Link to comment Share on other sites More sharing options...
souzadeveloper Posted July 3, 2018 Share Posted July 3, 2018 Bom dia Pessoal, estou tentando criar uma função para chamar o UniSweetAlert.. crio e configuro o componente em tempo de execução, ao tentar usar um Question, configuro o Evento OnSuccess, a Mensagem aparece mas o Evento não é disparado. Só funciona quando coloco o componente na Tela. Link to comment Share on other sites More sharing options...
nannoc Posted July 5, 2018 Share Posted July 5, 2018 Hi everyone I hope someone can assist. I installed the Delphi component on Delphi 10.2.3 (2017-08-04-uniSweetAlert V51), but keep on getting the attached error. I copied the js and css files to my app's "files" directory. Is there anything else I need to install for SweetAlert to work? Regards Donald Link to comment Share on other sites More sharing options...
Freeman35 Posted July 6, 2018 Share Posted July 6, 2018 check permission that file. If I'm not wrong, that error mean swal function not found and mean js file not include project. can check html file from browser Link to comment Share on other sites More sharing options...
nannoc Posted July 7, 2018 Share Posted July 7, 2018 check permission that file. If I'm not wrong, that error mean swal function not found and mean js file not include project. can check html file from browser Thank you for your response. I will check the permissions. How do I include the file in the project and how do I check with browser? Regards Donald Sent from my iPad using Tapatalk Link to comment Share on other sites More sharing options...
Freeman35 Posted July 8, 2018 Share Posted July 8, 2018 Hi, In browser, "Save to file" so easy way and press F12 ( In firefox ) On Server module, "Custom...." properties. Can find more detail in demo and help, in forum too. Link to comment Share on other sites More sharing options...
Pep Posted September 22, 2018 Share Posted September 22, 2018 Hello, First of all, thanks to CastleSoft for these components. I noticed that the "TUniJToast" component does not work properly with the "loader" property. If you choose false, the loader keeps showing. To correct, I made these changes in the function TUniJToast.BuildJsonParams: string; I changed these line bstr := bstr + 'loader:' + BoolToStr(loader) +','; for this bstr := bstr + 'loader:' + LowerCase(BoolToStr(loader, true)) +','; Link to comment Share on other sites More sharing options...
WMC Ederson Posted November 30, 2018 Share Posted November 30, 2018 On 9/22/2018 at 6:01 AM, Pep said: Hello, First of all, thanks to CastleSoft for these components. I noticed that the "TUniJToast" component does not work properly with the "loader" property. If you choose false, the loader keeps showing. To correct, I made these changes in the function TUniJToast.BuildJsonParams: string; I changed these line bstr := bstr + 'loader:' + BoolToStr(loader) +','; for this bstr := bstr + 'loader:' + LowerCase(BoolToStr(loader, true)) +','; Hey, I found some others issues on the code from jToast. There is what I changed (in uniJToast > BuildJsonParams): allowToastClose if allowToastClose then bstr := bstr + 'allowToastClose:true,' else bstr := bstr + 'allowToastClose:false,'; stack if (stack) then bstr := bstr + 'stack:' + IntToStr(stackSize) +',' else bstr := bstr + 'stack:false,'; position bstr := bstr + 'position:' + '"' + StringReplace(GetPosition(pos), '_', '-', [rfReplaceAll]) + '",'; loader (like Pep's post) if loader then begin bstr := bstr + 'loader:true,'; bstr := bstr + 'loaderBg: ' + '"' + loaderBg + '",'; end else bstr := bstr + 'loader:false,'; With these changes the component worked perfectly. Here is all procedure code: function TUniJToast.BuildJsonParams: string; var bstr: string; begin bstr := '{'; bstr := bstr + 'text:' + '"' + text + '",'; bstr := bstr + 'heading:' + '"' + heading + '",'; bstr := bstr + 'icon:' + '"' + GetIconType(icon) + '",'; bstr := bstr + 'showHideTransition:' + '"' + GetTransition(showHideTransition) + '",'; if allowToastClose then bstr := bstr + 'allowToastClose:true,' else bstr := bstr + 'allowToastClose:false,'; if hideAfter > 0 then bstr := bstr + 'hideAfter:' + IntToStr(hideAfter) + ','; if (stack) then bstr := bstr + 'stack:' + IntToStr(stackSize) +',' else bstr := bstr + 'stack:false,'; bstr := bstr + 'position:' + '"' + StringReplace(GetPosition(pos), '_', '-', [rfReplaceAll]) + '",'; bstr := bstr + 'textAlign:' + '"' + GetTextAlign(textAlign) + '",'; if loader then begin bstr := bstr + 'loader:true,'; bstr := bstr + 'loaderBg: ' + '"' + loaderBg + '",'; end else bstr := bstr + 'loader:false,'; // Add Callbacks here bstr := bstr + 'beforeShow: function() { ajaxRequest('+JSName+',"beforeShow",[]); },'; bstr := bstr + 'afterShown: function() { ajaxRequest('+JSName+',"afterShown",[]); },'; bstr := bstr + 'beforeHide: function() { ajaxRequest('+JSName+',"beforeHide",[]); },'; bstr := bstr + 'afterHidden: function() { ajaxRequest('+JSName+',"afterHidden",[]); }'; bstr := bstr + '}'; result := bstr; end; Link to comment Share on other sites More sharing options...
GerhardV Posted December 10, 2018 Share Posted December 10, 2018 You can add the following to the TUniJToast.BuildJsonParams function above for the background color and text color: if not bgColor.IsEmpty then bstr := bstr + 'bgColor:' + '"' + bgColor + '",'; if not textColor.IsEmpty then bstr := bstr + 'textColor:' + '"' + textColor + '",'; Link to comment Share on other sites More sharing options...
CastleSoft Posted December 11, 2018 Author Share Posted December 11, 2018 Code is now available via Github: https://github.com/CastleSoft/uiXtra Contains the latest source code (v1.07 - RIO release, uniGUI 1.5 (latest release) - Forum patches/updates in this thread ** Thank you all ** ) MIT lic.. Feel free to FORK / hack / etc. Sorry. I don't have much time these days to monitor the forums. Enjoy.. PS.. v1.06 is the original release for pre RIO / pre 1.5 / pre patches - if anyone needs it. Link to comment Share on other sites More sharing options...
Freeman35 Posted April 17, 2019 Share Posted April 17, 2019 I made some small modified change SweetAlert Ver. 8.8.5 Added "FooterText" property Added "PostionType" property Added ErrorHTML procedure Added ErrorTXT procedure Added Question_html procedure. VCL package separated and animation property editor added. Clean unused packages from dpk. (bpl size be decrease) Register procedures moved to VCL package Added animate.min.css 3.6.0 (3.7.0 has not tested maybe can be problem.) http://daneden.me/animate github: https://github.com/daneden/animate.css Test project modified for new properties I did in Tokyo and unigui Ver. 1480 (sencha 6.5.3) If you wanna use this code, its your own risk uniExtensions.7z 1 Link to comment Share on other sites More sharing options...
Freeman35 Posted April 18, 2019 Share Posted April 18, 2019 Fix typo. change in "uniSweetAlertPropEdit.pas" and in test project. main.pas (in TMainForm.UniFormBeforeShow) CommaText:= 'None,Default,bounce,bounceIn,bounceInDown,bounceInLeft,bounceInRight,bounceInUp,bounceOut,'+ 'bounceOutDown,bounceOutLeft,bounceOutRight,bounceOutUp,fadeIn,fadeInDown,fadeInDownBig,'+ 'fadeInLeft,fadeInLeftBig,fadeInRight,fadeInRightBig,fadeInUp,fadeInUpBig,fadeOut,fadeOutDown,'+ 'fadeOutDownBig,fadeOutLeft,fadeOutLeftBig,fadeOutRight,fadeOutRightBig,fadeOutUp,fadeOutUpBig,'+ 'flash,flipInX,flipInY,flipOutX,flipOutY,headShake,heartBeat,hinge,jackInTheBox,jello,lightSpeedIn,'+ 'lightSpeedOut,pulse,rollIn,rollOut,rotateIn,rotateInDownLeft,rotateInDownRight,rotateInUpLeft,'+ 'rotateInUpRight,rotateOut,rotateOutDownLeft,rotateOutDownRight,rotateOutUpLeft,rotateOutUpRight,'+ 'rubberBand,shake,slideInDown,slideInLeft,slideInRight,slideInUp,slideOutDown,slideOutLeft,slideOutRight,'+ 'slideOutUp,swing,tada,wobble,zoomIn,zoomInDown,zoomInLeft,zoomInRight,zoomInUp,zoomOut,'+ 'zoomOutDown,zoomOutLeft,zoomOutRight,zoomOutUp'; Link to comment Share on other sites More sharing options...
Freeman35 Posted April 18, 2019 Share Posted April 18, 2019 for question, I get allways "sucsess" event and I fixed it procedure TUniSweetAlert.ShowMessage; var ajaxCallbackStr, dismissCallbackStr, jsonSweetAlert: string; begin jsonSweetAlert := BuildJsonParams; // ajaxCallbackStr := BuildAjaxRequest('success'); // dismissCallbackStr := BuildAjaxRequest('dismiss','dismiss'); // Remarked, because always return "success" event !!!!! // UniSession.AddJS('swal.fire(' + jsonSweetAlert + ').then(function(){' + ajaxCallbackStr + ' return false; },function (dismiss) { '+ dismissCallbackStr + '});'); // AJT 2019-04-12 FIX Callback ajaxCallbackStr := BuildAjaxRequest('success'); dismissCallbackStr:= BuildAjaxRequest('dismiss'); jsonSweetAlert := 'swal.fire(' + jsonSweetAlert + ').then((result)=>{if(result.value){'+ajaxCallbackStr +'}else{'+dismissCallbackStr +'}});';//2019-04-18 Fixed. UniSession.AddJS(jsonSweetAlert); end; Link to comment Share on other sites More sharing options...
Point Posted May 30, 2020 Share Posted May 30, 2020 How to create new line message in sweetalert, for example : Information name : bla bla bla address : bla bla bla Link to comment Share on other sites More sharing options...
Freeman35 Posted May 30, 2020 Share Posted May 30, 2020 use hyml tag. for example "<br>" Link to comment Share on other sites More sharing options...
Sherzod Posted May 30, 2020 Share Posted May 30, 2020 5 hours ago, Popo said: name : bla bla bla address : bla bla bla UniSweetAlert1.Html := '<b>F</b>irst line<br>Second line'; Link to comment Share on other sites More sharing options...
x11 Posted October 20, 2020 Share Posted October 20, 2020 Component TUniJToast does not remember the position on the form in design-time Link to comment Share on other sites More sharing options...
x11 Posted October 20, 2020 Share Posted October 20, 2020 1 hour ago, x11 said: Component TUniJToast does not remember the position on the form in design-time I fixed it http://forums.unigui.com/index.php?/topic/15329-компонента-не-запоминает-свое-положение-на-форме-в-design-time/&do=findComment&comment=84104 Link to comment Share on other sites More sharing options...
picyka Posted January 28, 2022 Share Posted January 28, 2022 var UniJToast1 := TUniJToast.Criar(nil); UniJToast1.text := 'Um brinde progressivo' ; UniJToast1.loaderBg := '#FF0000'; UniJToast1.pos := TPosition.mid_center; UniJToast1.hideDepois := 10000; UniJToast1.Icon := TIconType.success; UniJToast1.ShowMessage; Good afternoon, I don't have the component installed, I create it at runtime, it works. But the icon does not appear, does anyone have any tips? Link to comment Share on other sites More sharing options...
x11 Posted January 30, 2022 Share Posted January 30, 2022 procedure TMessages.ShowToast(const Title, Text: String; MsgDlgType: TMsgDlgType; hideAfter: integer); Var UniJToast: TUniJToast; begin UniJToast := TUniJToast.Create(fParentForm); try case MsgDlgType of //TIconType = (none, success, error, warning, info); mtWarning : UniJToast.icon := TIconType.warning; mtConfirmation: UniJToast.icon := TIconType.success; mtError : UniJToast.icon := TIconType.error; mtInformation : UniJToast.icon := TIconType.info; else UniJToast.icon := TIconType.success; end;//case UniJToast.pos := TPosition.mid_center; UniJToast.allowToastClose := True; UniJToast.hideAfter := hideAfter; UniJToast.heading := Title; UniJToast.text := Text; UniJToast.ShowMessage; finally UniJToast.Free; end;// try-fin end; Link to comment Share on other sites More sharing options...
picyka Posted April 30, 2022 Share Posted April 30, 2022 Hi, I tried to use link in the message but I can't. has anyone done this? class procedure TToastUtils.Aviso(Text : String; Close: Boolean; Titulo : String; hideAfter : Integer); var lJToast: TuniJToast; begin lJToast := TuniJToast.Create(nil); try lJToast.Text := Text; lJToast.showHideTransition := TTransition.plain; lJToast.allowToastClose := Close; lJToast.stack := True; lJToast.stackSize := 4; lJToast.textAlign := TTextAlign.left; lJToast.pos := top_center; lJToast.loaderBg := '#ED9E00'; lJToast.bgColor := '#FFA900'; lJToast.textColor := '#FFFFFF'; lJToast.icon := TIconType.warning; lJToast.heading := Titulo; lJToast.hideAfter := hideAfter; lJToast.ShowMessage; finally FreeAndNil(lJToast); end; end; TToastUtils.Aviso('Yes! check this <a href="https://github.com/kamranahmedse/jquery-toast-plugin/commits/master">update</a>.', True) Link to comment Share on other sites More sharing options...
sunliner Posted February 13, 2023 Share Posted February 13, 2023 Thank you... appreciated Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now