-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call from javascript #5
Comments
@dadinugroho, I understand that issue opened 8 month ago, but this answer may be useful.
// @app/views/site/page.php
use kartik\growl\GrowlAsset;
use kartik\base\AnimateAsset;
GrowlAsset::register($this);
AnimateAsset::register($this);
// @app/controllers/AjaxController.php
public function actionBar()
{
// some stuff you handle
return [
'success' => true,
'growl' => [
'title' => '<h3>Success!</h3>',
'message' => '<p>Some message</p>',
'type' => 'success',
// other params
],
];
}
$.notify(responseData.growl.title, responseData.growl); |
Thank you for your answer. My further question is where I should put $.notify ? I am using renderAjax from johnitvn ajaxcrud extension. |
You should put it where you handle your ajax response, it can be in done() promise |
how about other params?
'message' - not work for me 'delay' => 5000, - work where you can read the rest of the parameters? |
This is working for me, doc link: http://bootstrap-growl.remabledesigns.com/ |
I use ajax to send form and get response in form of JSON. The response contains type (success/error), title, and message. How could I call the growl from javascript given I have title and message?
Thanks a lot.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: