You can’t do die(‘click’) it is wrong and not working.
you can remove it cause it do nothing and not solves the issues it should
–
so as I said every itme you replace the data in some #ajaxDiv the event add up…
Witch events?
The pagination…
After prassing again and again on the ajaxLink after some CGridView loads, every time you paginate, for example you pushed 10 times on ajaxLink, in pagination it will send 10 requests.
if you push delete, it will send 10 times confirmation message, and potentially 10 times the request…
FOr demo you could just create some CArrayDataProvider with $_SERVER data
and load it into div via ajaxLink … replace => #ajaxDiv
dont forget to add the CButtonColumnm and turn on firebug to see that pagination will send trillion requests after few pushes on ajaxLink…
There is also issue with ajaxSubmitButton…
they just not meant to work - loaded via ajax into some element.
Actually it is a little bit hard to put something online right now(cause it will be public and every one will enter)
Я не знаю почему так сложно понять суть проблемы, может на русском проще?
Создается ajaxLink который подгружает CGridView с данными в [b]<div id="ajaxPlace"></div>
[/b] , ПРи первом нажатие на ajaxLink все ок, дальше если подгружает пару раз, то к примеру каждое нажатие пагинации уже будет срабатывать более одного раза, в соответсвии с количеством нажатия на ajaxLink который делал replace=>‘ajaxPlace’
То же самое и с CButtonColumn с кнопками удаления которые будут спрашивать конфирм теперь десяток раз.
А все оптому что die(‘click’) не работает так как вы предполагаете.
Я выше продемонстрировал как решить проблему,и дал ссылку на ресурс который объесняет что такое die.
now in english:
Create ajaxLink that loades via replace=>ajaxPLace , CGridView into some div with ajaxPlace id.
Do it multiple times, and you will see that events are add up, the pagination send request a lot of times, the delete confirmation alot of times, and also the delet request will be sent a lot of time.
All of this because die(‘click’) not kill the live events outside it’s block, it is not a “global killer” so you can remove it, it does nothing…
[quote name=‘Steve Schwartz@Alfa Jango’]When using these functions, there is one major shortcoming to the .die() method. You can ONLY use it for the exact element selector for which the .live() function was invoked.
[/quote]
Where did you find information about die working only in the same block click was attached? I checked die() documentation and they mention only exact selector issue.
I tested it… you cant do die(‘click’) it works, but not like global killer… you can find more in google and stack overflow … I have the latest jQuery, so that is not a problem…
the only solution to put some hidden or you cant load CGridView via ajax multiple itme
Any updates on this issue…Since i am getting the same problem in my app. Which is still not resolved.I am using yii 1.1.10 and dont know why i am getting this error.