Issue
I have CGriview with ajax button,but when i click on the button, the page refreshed and doesnt send ajax parameter to my action,my code is like this:
enter code here
array(
'class'=>'CButtonColumn',
'template'=>'{reset}',
'buttons'=>array(
'reset'=>array(
'label'=>'reset',
'url'=>'Yii::app()->controller->createUrl("place/viewHallModal/",array("row"=>"1"))',
'options'=>array(
'class' => 'btn',
'ajax'=>array(
'type'=>'post',
'url'=>'js:$(this).attr("href")',
'update'=>'#section-update',
'success' =>'js:function(data) {alert("suc");}'
)),
),
),
),
Solution
I haven't 50+ reputation for commenting, so I can help you only with answering to the question.
In jQuery
you can write this ajax function like this
...
$.ajax({
type: 'post',
url: 'your_url_will_goes_here',
cache: false, // or true
data: {
'your_data': $variable,
'your_data1': $variable1,
},
success: function(data){
alert("success !");
});
....
but I couldn't see your data
ajax function.
So which data
you want to pass to your action?
Answered By - Mirjalal
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.