Trouble with AJAX indicator

Discussion around this tutorial for symfony 1.0.x

Moderators: dwhittle, Ian

Trouble with AJAX indicator

Postby 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 ?
Last edited by sysyem on Wed Sep 03, 2008 10:47 am, edited 1 time in total.
sysyem
Junior Member
 
Posts: 2
Joined: Fri Aug 15, 2008 5:57 am

Re: Trouble with AJAX indicator

Postby 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


Return to askeet

Who is online

Users browsing this forum: No registered users and 3 guests