apollo / yii2-ajaxbutton
AjaxButton
Installs: 89
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
pkg:composer/apollo/yii2-ajaxbutton
Requires
- php: >=5.4
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2025-10-07 11:18:47 UTC
README
#Html Helper for create AjaxButton
Usage:
\Apollo\AjaxButton::begin(['label'=>'label', 'elements'=>['id'=>array of id's] // generate code for id's as $( '#id1','#id2'.... ).click(function(event){...} 'ajaxOptions'=>[ 'type'=>'POST', 'afterClick'=>new \yii\web\JsExpression('alert(Clicked)'); 'url'=>'google', 'success'=>new \yii\web\JsExpression('function(){location.reload()}'), 'beforeSend'=> new \yii\web\JsExpression("function(){ var data=jQuery('#gridID').yiiGridView('getSelectedRows'); if(data=='') { alert('You do not choose!'); return false; } if (confirm('Are you sure you want to delete this items?')) { return true; } else { return false; } }" ), ]]); \Apollo\AjaxButton::end();