This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Trouble with AJAX indicator

Discussion around this tutorial for symfony 1.0.x

Trouble with AJAX indicator

by sysyem » Fri Aug 15, 2008 6:11 am

I have a problem with the Ajax Indicator, I want to show it in div id=mark_xx, but i dont know how to do it. I tried this in _interested_user helper but the indicator.gif not appear there.

...
<div class="interested_mark" id="mark_<?php echo $question->getId() ?>">
<div id="indicator_<?php echo $question->getId() ?>" style="display: none"></div>
<?php echo $question->getInterestedUsers() ?>
</div>

<?php echo link_to_user_interested($sf_user, $question) ?>

and I put this in the helper function:
...
else
{
// didn't declare interest yet
$indicator = "'indicator_".$question->getId()."'";
return link_to_remote('interested?', array(
'url' => 'user/interested?id='.$question->getId(),
'update' => array ('success' => 'block_'.$question->getId()),
'loading' => "Element.show(".$indicator.")",
'complete' => "Element.hide(".$indicator.");".visual_effect('highlight', 'mark_'.$question->getId()),
));
}
...

any suggestion ?
sysyem
Junior Member
 
Posts: 2
Joined: Fri Aug 15, 2008 5:57 am

Re: Trouble with AJAX indicator

by volod » Fri Nov 14, 2008 5:02 pm

I just had same problem and was going to post that have cannot solve, but I was lucky and got an idea that solved my problem:

so, the solution is: don't place your indicator inside of 'update' item (the one that will be reloaded). Guess why? :)~ :-)~ :smile:
volod
Member
 
Posts: 85
Joined: Wed Jun 25, 2008 7:00 pm