Quantcast
Channel: blog@hasselba.ch
Viewing all articles
Browse latest Browse all 169

Yii: GridView’s selectionChanged not working on iOS

$
0
0

I had a strange issue with TbGridView‘s (YiiStrap‘s version of CGridView) selectionChanged event: In all browsers, the defined function was executed when a row was selected, but not on devices with iOS 7 & 8.

While trying to hack around the issue, I found a simple solution by adding

'htmlOptions' => array( 'onclick' => '' )

to the declaration of the grid. This little hack kills the inherited event handler from the body element by adding an empty onclick event to the generated <div>:

<div class="grid-view" id="yw0" onclick="">

Now everything works accross all browsers and devices.


Viewing all articles
Browse latest Browse all 169

Trending Articles