Yii Framework Forum: ajax, and doubled links - Yii Framework Forum

Jump to content

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

ajax, and doubled links Rate Topic: -----

#1 User is offline   jnosul 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 07-July 10

Posted 19 July 2010 - 10:57 AM

Hi,

I have a dropdown list which from I get products, filtered by producers. It works in ajax, the output is product list, I get it using clistview, which in the partial view has another ajax button -> adding the product to the shopping cart. The problem is that when I want to add product, the ajax request is being made twice - I see it in the firebug. Ofcourse i see it in the shopping cart as well ( product quantity * 2 ). The problem is in ajax and clistview, cause shopping cart is being used in the different parts of the shop as well, and in ajax as well, everything works ok. Probably the case of default clistview class and id name conventions, but i dont wanna change it untill im sure they are tha pain. It seems as if the event was being added twice to the button. Help the nooby please :) What is the problem?
0

#2 User is offline   zaccaria 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 2,232
  • Joined: 04-October 09
  • Location:Moscow

Posted 20 July 2010 - 02:36 AM

The problem is how CClientScript work right now.

It happens if you do renderPartial(..., false, true).

There are no standard solution right now, I posted a workaround here, I would be glad if you try it and if you can give us a feedback.

Already another user experimented it with success.
0

#3 User is offline   jnosul 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 07-July 10

Posted 20 July 2010 - 06:24 AM

View Postzaccaria, on 20 July 2010 - 02:36 AM, said:

The problem is how CClientScript work right now.

It happens if you do renderPartial(..., false, true).

There are no standard solution right now, I posted a workaround here, I would be glad if you try it and if you can give us a feedback.

Already another user experimented it with success.


huh, ok, thanks for this one. Unfortunately, I dont have too much time to experiment with this solution, so I will write my own event handling function in my js file instead of using ajaxlink within this partial view. Anyway I will try and play more with the issue afterhours, cause I have occured that problem before( had to get rid of ajax before, cause I wanted to keep sort and paging operations )..
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