Request SendFile doesn't work with Ajax

I have observed that when I execute the function:

Yii :: $ app->request->sendFile()

within a row with a gridView, instead of launching the file, it shows it embedded in the HTML. Then if I remove the Pjax :: begin () and Pjax :: end () borders that enclose the GridView, Then download works. How can I work with both functionalities without losing one of them?

I am sorry to have worried you with this question. The solution was simple. Place the property ‘data-pjax’ => 0 in the download link and now they work, both. Thank you very much