$('#export-button').on('click',function() {
    $.fn.yiiGridView.export();
});
$.fn.yiiGridView.export = function() {
    $.fn.yiiGridView.update('dates-grid',{
        success: function() {
            $('#dates-grid').removeClass('grid-view-loading');
            window.location = '". $this->createUrl('exportFile')  . "';
        },
        data: $('.search-form form').serialize() + '&export=true'
    });
}
Ругается на  $.fn.yiiGridView.export();
и window.location = '". $this->createUrl('exportFile')  . "';  
как исправить?