Yii Framework Forum: screen hangs on ajax div update, using ajaxSubmitButton - Yii Framework Forum

Jump to content

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

screen hangs on ajax div update, using ajaxSubmitButton Rate Topic: -----

#1 User is offline   rohit 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 71
  • Joined: 08-July 09
  • Location:India

Posted 05 March 2010 - 02:58 AM

<div class="row submit">
		<?php echo CHtml::ajaxSubmitButton(
            'Search',
						CController::createUrl('user/search'),
            array(
              'update'=>'#ajaxUpdate',
              'cache'=>true,
							'beforeSend' => 'function(){
                $("#ajaxUpdate").addClass("loading");
              }',
            ),
						array(
							'id'=>'search',
						)
          );
    ?>
	</div>

Using this, i'm trying to update div id #ajaxUpdate. Now when net connection is slow, or takes time to load the results, full screen hangs! What is the use, if i'm using ajax, to keep screen interactive and it is not achieved!

Please help me with some solution... what is making screen hang?
0

#2 User is offline   rohit 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 71
  • Joined: 08-July 09
  • Location:India

Posted 06 March 2010 - 11:32 AM

*Bump*
Sorry, to bump. but I'm still having this problem... Is there any solution?
0

#3 User is offline   bettor 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 752
  • Joined: 02-February 09

Posted 07 March 2010 - 08:23 AM

View Postrohit, on 06 March 2010 - 11:32 AM, said:

*Bump*
Sorry, to bump. but I'm still having this problem... Is there any solution?


what do you mean screen hangs? your browsers freezes? i guess you may be mislead by the fact that you activate loading indication and you never switch if off.

to better understand your problem please try this code and let me know if things are better:

 <?php echo CHtml::ajaxSubmitButton(
            'Search',
            CController::createUrl('user/search'),
            array(
              'update'=>'#ajaxUpdate',
              'cache'=>true,
              'beforeSend' => 'function(){
                $("#ajaxUpdate").addClass("loading");}',
              'complete' => 'function(){
                $("#ajaxUpdate").removeClass("loading");}',
            ),
                                                array(
                                                        'id'=>'search',
                                                )
          );
    ?>
        </div>

0

#4 User is offline   rohit 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 71
  • Joined: 08-July 09
  • Location:India

Posted 07 March 2010 - 10:48 AM

oops, I forgot to post
'complete' => 'function(){
                $("#ajaxUpdate").removeClass("loading");}',


It is there in my code! Its just browser freezes until data is loading. Once done, it gets normal again.
Even if I don't add that class "loading" , it still freezes!
0

#5 User is offline   rohit 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 71
  • Joined: 08-July 09
  • Location:India

Posted 07 March 2010 - 10:52 AM

Try to use search on following link,
http://hubsonline.byethost3.com/ if net is at moderate speed, you will find difference, else I am not sure!
Please let me know if you find the same problem...
0

#6 User is offline   bettor 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 752
  • Joined: 02-February 09

Posted 07 March 2010 - 11:54 AM

View Postrohit, on 07 March 2010 - 10:52 AM, said:

Try to use search on following link,
http://hubsonline.byethost3.com/ if net is at moderate speed, you will find difference, else I am not sure!
Please let me know if you find the same problem...


I had no problem searching your forms...not at all
0

#7 User is offline   rohit 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 71
  • Joined: 08-July 09
  • Location:India

Posted 07 March 2010 - 12:51 PM

Thanks for reply! Seems, if net is slow, then only it hangs, until it gets results... !
What I noticed is, when dom is getting updated and simultaneously results are loading in the background... then it hangs!
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