Problem with {javascript return false} after AJAX and PJAX refresh

Hi folks,

I am using Kartik superb GridView widget. In beforeHeader I have changed the label into a "select all" button which runs and AJAX call…

$('.select-all-button').click(function() {


        url: $(this).attr('href'),

        type: 'POST',

        success: function(result) {





return false;


The issue I am having with this is that if I run the $.pjax.reload function, then return false does not seem to work and it takes me to the anchor URL.

Is there a way around this?