0
votes

I can get row's id of CGridView.

   $(document).ready(function()
    {
        $('body').on('dblclick', '#demo-grid tbody tr', function(event)
        {
            var
                rowNum = $(this).index(),
                keys = $('#demo-grid > div.keys > span'),
                rowId = keys.eq(rowNum).text();
        }
        );
    });

rowId and post id are equal. First column of my grid contains title as href to acitionView with post id and post title as parametres.

<a href="/Demo/index.php/post/2/A+Test+Post">A Test Post</a> when id:2 and title: A Test Post

Yii::app()->createUrl('post/', array(
            'id'=>$this->id,
            'title'=>CHtml::encode($data->title)

But now i don't know how to get access to that href in jquery function to rediret when row is doubleclicked. Any ideas?

Not sure if I understand. You're trying to redirect only when tr's double clicked? Firstly You should catch if it's one clicked and prevent redirect. Then get attribute by $(this).find('td:first-child').attr('href') on double clicked and simply redirect.Patryk Radziszewski
Dzięki, spróbuję i napiszę jak poszło.Bejkrools