CGridView uses AJAX to update (by default) in doing so it removes the elements that were originally hooked by and brings in new ones. This is why moving to another page or reordering won't trigger fancybox. You can set CGridView to run a jQuery function to hook the new elements after CGridView updates by using the property afterAjaxUpdate.