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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -