Search code examples
gridviewyii2pjax

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?


Solution

  • 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 ...
    });