开发者

Jgrowl like notification using dojo

开发者 https://www.devze.com 2023-03-14 20:37 出处:网络
Is there anything in开发者_如何学编程 Dojo like the jquery jgrowl.There exists dojox.widget.Toaster. (Test-File & API Documentation)

Is there anything in开发者_如何学编程 Dojo like the jquery jgrowl.


There exists dojox.widget.Toaster. (Test-File & API Documentation)

You need to create a new channel with the Toaster, for example.

var errors = new dojox.widget.Toaster({
    messageTopic: '/app/error',
    positionDirection: 'br-up',
    duration: 5000
});

After this you can publish with dojo.publish to the channel /app/error

dojo.publish('/app/error', ["Error sending data"]);

Don't forget to load the Toaster CSS dojox/widget/Toaster/Toaster.css

If you want it black, you need to change the CSS. I created an example with two Toasters, one displays new messages in the right upper corner, the other in the right bottom corner. And i made them black.

JS Fiddle


Check out this github project.

I was looking for the same thing, but with a bit more features than the Toaster widget provided. So I started the dGrowl project.

0

精彩评论

暂无评论...
验证码 换一张
取 消