Disable "Check All" checkbox in CGridView

Hi,

I need to allow user to select more than one row in a Grid, so i have set the SelectableRows to 2. However, this has enabled "Check All" checkbox in the header. I do not want this checkbox. How do I hide this checkbox?

I tried

$(‘input.select-on-check-all’).hide();

however, a call to

$.fn.yiiGridView.update("grid_id");

is enabling the "Check All" checkbox again. however to hide it permanently

Thanks

Ajitha

Hi,

Anybody got any thoughts on this?

Thanks

Ajitha

There is no option by default for this…

You can use the afterAjaxUpdate property to "again" hide the checkbox on every grid refresh - http://www.yiiframework.com/doc/api/1.1/CGridView#afterAjaxUpdate-detail


'afterAjaxUpdate'=>"function() { $('input.select-on-check-all'').hide(); }",

Hi Mdomba,

That worked great! Thanks for your tip.