Getting Heap Size error, but 'Max # of records (Limit)' is not working for me.

Thanks for the above link. Using that, I got below code which helped me in getting all the data on page load. 
(function(skuid){
var $ = skuid.$;
$(document.body).one(‘pageload’,function(){
      var model = skuid.model.list()[2];
      model.recordsLimit = 500;
      $.blockUI({ message: ‘Loading all available ‘+model.label+’…’ });
      model.loadAllRemainingRecords({
         stepCallback: function(offsetStart,offsetEnd) {
            $.blockUI({ message: ‘Loading ’ + model.label + ’ ’ + offsetStart + ’ to ’ + offsetEnd + ‘…’ });
         },
         finishCallback: function(totalRecordsRetrieved) {
            $.blockUI({ message: ‘Finished loading all ’ + totalRecordsRetrieved + ’ ’ + model.labelPlural +’!’, timeout: 2000 });
         }
      });
});
})(skuid);

But, there are some filters on my page, when I apply any filter, it again starts displaying data in chunks, and I have to press ‘Load More’ action to display more records. Need to know, how can I make the above code work even when I apply any filters. As, there is no option to add action on these filters, then from where I can call this snippet and how can I make my functionality run as expected (i.e load all the data in one go even after applying filters). Please suggest the best. If there is any way the above code could work for my requirement, then please share how to make it happen & where to call this snippet, and the above code is for page load, so on selection of any filter if this code needs any modification then please share the modified code with me as I have not much knowledge about js. Thanks for the help in advance.