1
我想在我的JSF项目中使用像这样一个https://github.com/mouse0270/bootstrap-growl的Bootstrap Growl消息,但我不知道如何配置它。我希望在动作完成时显示它(它应该返回失败或成功)。在JSF应用程序中使用Bootstrap Growl消息
任何想法?
谢谢
我想在我的JSF项目中使用像这样一个https://github.com/mouse0270/bootstrap-growl的Bootstrap Growl消息,但我不知道如何配置它。我希望在动作完成时显示它(它应该返回失败或成功)。在JSF应用程序中使用Bootstrap Growl消息
任何想法?
谢谢
我希望我会注意到这个ealier。如果您仍然在使用我的插件,那么您将如何调用它。
您也可以在我的Bootstrap Growl Website(最新版)插件
找到文档和示例,如果使用的版本1.0.6,并希望只显示一条消息。
var request = $.ajax({...});
request.done(function(msg) {
$.growl('Successful', { type: 'success' });
});
request.fail(function(jqXHR, textStatus) {
$.growl({ title: 'Request failed: ', message: textStatus }, { type: 'success' });
});
如果使用版本2.0.0(昨天刚刚发布)并且想要显示消息。在这个新版本中,您可以更新咆哮。
var growl = $.growl({
title: 'Please Wait... ',
message: 'Updating Database'
},{
type: 'info',
allow_dismiss: false,
delay: 0
}),
request = $.ajax({...});
request.done(function(msg) {
// Update growl with success info
growl.update('title', 'Success ');
growl.update('message', 'Your changes have been saved');
growl.update('type', 'success');
// Since we disabled both the dismiss and delay we have to close
// the growl manually. This closes it after 5 seconds.
setInterval(function() {
growl.close();
}, 5000);
});
request.fail(function(jqXHR, textStatus) {
// Update growl with failed info
growl.update('title', 'Request failed: ');
growl.update('message', textStatus);
growl.update('type', 'danger');
// Since we disabled both the dismiss and delay we have to close
// the growl manually. This closes it after 5 seconds.
setInterval(function() {
growl.close();
}, 5000);
});