Double Clicking On Grid View Row Gives Unpredictable Results

I’m not sure if this is a feature or a bug. For most of my admin views, I have code like this:

<?php $this->widget('zii.widgets.grid.CGridView', array(












	'selectionChanged'=>"function(id){window.location='" . Yii::app()->urlManager->createUrl('deposit') . "/' + $.fn.yiiGridView.getSelection(id);}",

)); ?>

With this setup, when I click on the grid view row, I get the view of that model.

However, I noticed yesterday, that if I double click on the row, sometimes I get the model view and sometimes I get the index view. It seems like in my development environment I get the model, but on the server I get the index view. It looks to me like maybe the double click is creating two calls. On the first click it retrieves the id okay and gives me the model view, but then it processes the second click. By that time, the page has changed enough that it can’t retrieve the id, so it gives me the index view, which is basically the model view but without an id.

Anyone else run into this? Is it supposed to work like this? Any obvious work around that I am missing?

I have done something like this:

					'afterAjaxUpdate'=>'function(id, data){

						var gridTable = $(data).find("div#bicycle-grid>table");

						$("div#bicycle-grid>table>tbody>tr").bind("dblclick", function()





and made the function like this:









	function dblClickRow(theRow)


		var theUrl = $(theRow).find('a.update').attr('href');




This worked for me, hope it will work for you as well.