ajax - ajaxSubmitButton beforeSend add vars to request -


i have ajaxsubmitbutton beforesend option:

echo chtml::ajaxsubmitbutton('', chtml::normalizeurl(array('site/index')),      array(         'datatype'=>'json',         'data'=>'js:jquery(this).parents("form").serialize()',         'beforesend'=>'js:function(data){             // myarr "good" array param             mydata =$.param(myarr);             /** somethig **/         }',                   ) ); 

so how can add mydata request data , send post request?

it's easier expect, need create function returns params:

<script type="text/javascript"> function getmydata(){     return $.param(myarr); } </script> 

and concatenate data:

echo chtml::ajaxsubmitbutton('', chtml::normalizeurl(array('site/index')),      array(         'datatype'=>'json',         'data'=>'js:jquery(this).parents("form").serialize()+"&"+getmydata()',         'beforesend'=>'js:function(data){         }',                   ) ); 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -