2017 © Pedro Peláez
 

library yii2-ajaxbutton

AjaxButton

image

apollo/yii2-ajaxbutton

AjaxButton

  • Wednesday, July 2, 2014
  • by vov4ik08
  • Repository
  • 2 Watchers
  • 0 Stars
  • 81 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Html Helper for create AjaxButton

Usage:, (*1)

\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();

The Versions

02/07 2014

dev-master

9999999-dev http://google.com

AjaxButton

  Sources   Download

MIT

The Requires

 

ajax button