I’m using alertify (http://alertifyjs.org) for nice looking dialogs but cannot integrate it in sc for custom dialogs. It will be very nice if sc itself integrate Alertify for nice looking dialogs in their future release.
What’s exactly your problem?
- Copy Alertify files to _lib folder of your project for example.
- Add references to your header template*
- Add 2 javascript buttons to your grid, and add alertify code.
- Enjoy.
- Instead using header templaet, you can integrate just in 1 application, using on your onApplicationInit something like:
?>
<link rel="stylesheet" href="./_lib/alertify/css/alertify.css" />
<script src="../_lib/alertify/js/alertify.min.js"></script>
<?
Thank you very much Giuseppe. It works. But I want to use on php button also is that possible?
You can try creating a Javascript method and calling it from a button using sc_ajax_javascript
sc_ajax_javascript( ‘JavascriptMethodName’, array(“parameter”))
Hi,
just to save you some headaches. sc_ajax_javascript doesn’t run on php button you have to take a little detour.
From your button call a php method like php_alertify() and from there call your javascript method like Giu suggested.
jsb
Hello,
I will discuss your suggestion with our team.
regards,
Bernhard Bernsmann
Dear Giuseppe and JSB thank you guys. It works like a charm! :o
Thanks Bernhard Bernsmann for taking it.
Hi, i tried use alertify from a button php but do not worked, i did:
Create a button php: b_php with this script: php_alertify();
Create a method php: php_alertify with this script: sc_ajax_javascript(“js_alertify”);
Create a method javascript: js_alertify with this script: alertify.alert("Hello ");
But i cliked on button b_php and it navigates and do not shows nothing.
Which is the error?
Hard to say. Are JS and CSS files loaded? Did you checked web console to see if some error appears?
Yes, i tested and files are loaded.
Addittionality i Create a button JS: b_js with this script: js_alertify(); and it work. show dialog (files are loaded)
But when i cliked on button PHP b_php it navigates and do not shows nothing.