Kap
Kap

Reputation: 1

JQX Notification Widget showing multiple messages

Currently I am using jqx notification widget where a click on a button below code executes. But the problem is it displays multiple messages when we click on a button. I want to restrict it to single notification when we click on that button. Once it fades and the user clicks on that button it should display that message.

$('#dialog').after("<div id = 'jqxNotification' style='display: none;'>Saved Successfully.</div>");
$("#jqxNotification").jqxNotification({ width: 250, position: "top-right", opacity: 0.9,
        autoOpen: true, animationOpenDelay: 800, autoClose: true, template: "success"
});

Upvotes: 0

Views: 190

Answers (1)

Ravi Makwana
Ravi Makwana

Reputation: 2918

Here's some tips

There's no any setting for to do this, but what you can do is
before open showing notification hide all previous all notification by property .jqxNotification("closeAll")

function showMessage() {
   $("#jqxNotification").jqxNotification("closeAll");
   $('#dialog').after("<div id = 'jqxNotification' style='display: none;'>Saved Successfully.</div>");

   $("#jqxNotification").jqxNotification({ width: 250, position: "top-right", opacity: 0.9,
        autoOpen: true, animationOpenDelay: 800, autoClose: true, template: "success"
   });
}

showMessage()
setTimeout(showMessage,1000);

Upvotes: 0

Related Questions