Jump to content
uniGUI Discussion Forums
Sign in to follow this  
Freeman35

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

Recommended Posts

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

Share this post


Link to post
Share on other sites

Hi

 

You can add this to your js code

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

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×