Jump to content


Photo

How can I add ajaxRequest button's onclick in toastr ?


  • Please log in to reply
2 replies to this topic

#1 Freeman35

Freeman35

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 348 posts

Posted 01 July 2018 - 10:38 AM

Hello,

This is command for toastr ( https://github.com/CodeSeven/toastr )

Command: toastr["success"]("<div><button type="button" id="okBtn" class="btn btn-primary">Close me</button><button type="button" id="surpriseBtn" class="btn" style="margin: 0 8px 0 8px">Surprise me</button></div>")

This command add two more button on toastr, I wanna add ajaxRequest command on onclick event for each one. I'm try this command but not work.

And I'm trying in "TmyToaststr = class(TUniComponent)" for my useage. JSName for this component.

onclick:function(){ajaxRequest('+JSName+',''clicked'',[''clickedOn=btn_1'']); }

regards


  • 0

#2 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 5177 posts

Posted 01 July 2018 - 10:49 AM

Hello,

 

Can you make a simple testcase for this... ?!


  • 0

#3 Hayri Aslan

Hayri Aslan

    Advanced Member

  • Moderators
  • 459 posts
  • Location─░stanbul - Turkey

Posted 08 July 2018 - 07:21 PM

Hi

 

You can add this to your js code

$('#okBtn').click(function(){
    ajaxRequest(JSNAME, "okBtn");
});

$('#surpriseBtn').click(function(){
    ajaxRequest(JSNAME, "surpriseBtn");
});

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users