CGridView and Ipad

Hello Everyone!

There is anyone with a problem in Cgridview when open in ipad or iphone?

When i open in my iphone i cant click in the grid (the click doesnt work)…

why?

up!!!!!

up!!!!!

I has the same problem… someone?

It’s something difficult to say anything about it. May be something wrong with your Iphone…

Elder found the aswer:

The click event on safari is not working correclty, try add an onclick="undefined" into you tr element inside the renderTableRow method in CGridView class.

The problem is not with my iphone because this problem it’s happening in many devices based on iOS. In Android, for example, is 100% functional. The solution mentioned below, by Eric, it’s simple, strange, but works.

This is an old thread, but I thought I would add something to it… The trick mentioned by Eric M works, but an easier way to achieve it, in my opinion, is to use jQuery to set the onClick function for the <tr> elements:


Yii::app()->clientScript->registerScript('some_unique_id',

    "$('#your_grid_id tr').attr('onClick', 'undefined');",

    CClientScript::POS_READY

);

It’s safari’s issue, I have similar issue before. It was working in other type of browser, only did not work on Safari. But after upgrade to new, the issue fixed. Will try tomvdp’s solution.

It also happens with Chrome on iPad. So it is not just Safari that has this issue.

This slightly more generic code does the job too:


Yii::app()->clientScript->registerScript('iPad_fix_grid',

    "$('.grid-view tr').attr('onClick', 'undefined');",

    CClientScript::POS_READY

);