Yii Framework Forum: Ajaxlink Not Working - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Ajaxlink Not Working Rate Topic: -----

#1 User is offline   Ravi P Thanki 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 61
  • Joined: 18-March 13
  • Location:Ahmedabad

Posted 10 September 2013 - 06:24 AM

Hello Everyone,

I have problem in ajaxlink. my code is

$action = controller/action;

$var .= CHtml::ajaxLink($rt,array($action),array(// ajaxOptions
'type' => 'POST',
'DataType' => 'json',
'success' =>"js:function(data)
{
$('div .message_container').html(data);
var str = data;
var n = str.charAt(40);
$('#rpt .ext').html(n);
$('#rpt1 .ext').html(n);
}",
'data' => array('val1'=>$dr['user_id'],'val2'=>$mn['log_id']),
));
echo $var;
exit;


In controller i make one view and send to view using jquery but ajaxlink url is not working in view.
means action is not called from view.
Ravi Thanki
Yii,Cakephp and Magento Developer,
blog:http://ravithanki.wordpress.com
0

#2 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,005
  • Joined: 16-February 11
  • Location:Japan

Posted 27 September 2013 - 09:26 PM

/* Moved from "Bug Discussions" to "General Discussion for Yii 1.1.x" */
0

#3 User is offline   Balu 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 151
  • Joined: 09-August 11
  • Location:Kerala, India

Posted 28 September 2013 - 01:38 AM

View PostRavi P Thanki, on 10 September 2013 - 06:24 AM, said:

Hello Everyone,

I have problem in ajaxlink. my code is

$action = controller/action;

$var .= CHtml::ajaxLink($rt,array($action),array(// ajaxOptions
'type' => 'POST',
'DataType' => 'json',
'success' =>"js:function(data)
{
$('div .message_container').html(data);
var str = data;
var n = str.charAt(40);
$('#rpt .ext').html(n);
$('#rpt1 .ext').html(n);
}",
'data' => array('val1'=>$dr['user_id'],'val2'=>$mn['log_id']),
));
echo $var;
exit;


In controller i make one view and send to view using jquery but ajaxlink url is not working in view.
means action is not called from view.


Make the action url like this

$this->createUrl('controller/action'),


check this action is defined in access rules on that controller..
check jquery is defined in the top.
and check with url and errors in error console with firebug
1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users