Yii Framework Forum: Ajax Update And Another Chtml::link Messed Up. - Yii Framework Forum

Jump to content

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

Ajax Update And Another Chtml::link Messed Up. Rate Topic: ***** 1 Votes

#1 User is offline   jiaming 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 262
  • Joined: 10-April 12

Posted 09 October 2012 - 10:22 AM

Dear all,

I have the following buttons in the same page:

echo CHtml::link('<i class="icon-flag"></i> Report abuse',"#", array('submit'=>array('report', 'id'=>$model->id),'confirm' => 'Are you sure to report this post as an inappropriate post?','class'=>'btn btn-mini btn-action'));


echo CHtml::ajaxLink("<i class='icon-star icon-white'></i>Like", $this->createUrl('post/voteup', array('id' => $post->id)), array('update'=>'#ajaxgame'.$post->id), array('class'=>'btn btn-mini btn-success'));


Here is the update:

<?php
echo CHtml::ajaxLink('<i class="icon-remove icon-white"></i> Liked', 'http://123.com/posts/votedown/'.$id, array('update'=>'#ajaxgame'.$id), array('class'=>'btn btn-mini btn-success active'));
Yii::app()->getClientScript()->registerCoreScript('yii'); 
?>



Right now, each time I click like, and it updates to the code right above. And If i click again, it not updates to the code votedown...instead...it triggers the report action...

So weird..

Any ideas?
0

#2 User is offline   jiaming 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 262
  • Joined: 10-April 12

Posted 09 October 2012 - 05:59 PM

It's so weird....If I delete

Yii::app()->getClientScript()->registerCoreScript('yii');

It just tells me that Jquery.yii is not defined..
0
0

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