Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

yii2 gridview pjax event

I would like to run a script after sort gridview where pjax is active. I could not find any event handler after reload of gridview. Is there any proper way of event handler after pjax call and refresh of gridview?

like image 257
mustafa.yavuz Avatar asked Dec 28 '15 09:12

mustafa.yavuz


1 Answers

Yii2 Pjax widget is just a wrapper of defunkt/jquery-pjax library, so you can view available events list in official Pjax docs in events section. Seems like you need to use pjax:success event:

$(document).on('pjax:success', function() {
    // Your code goes here ...
});
like image 165
arogachev Avatar answered Sep 28 '22 08:09

arogachev