Help with filter scopes and recordfinder paginated results

I am using a filter scope on a recordfinder field. The scope function uses values from other fields to filter this field. Because recordfinder is a form widget, I have to use post() data to get the values of those other fields (model is not populated). This works when the recordfinder widget first launches as all the form data is there under a key of the same name as the form. But when the results are paginated, the scope filter runs again and does not get the form data. Is there anything I can do short of storing the original form data in a sessinon variable?

Hello, This problem can be solved with some javascript. You’ll need to add an ID of the parent form and also find the ID of the recordfinder, for example:

<div id="RecordFinder-formPhone-popup-phone" class="recordfinder-popup">

Then use events to tether the parent form to the record finder form. Here is an example:

$(document).on('ajaxSetup', '#RecordFinder-formPhone-popup-phone form', function(event, context) {
    var $myform = $('#myform'),
        data = context.options.data;

    data['field1'] = $('input[name=field1]', $myform).val();
});

I haven’t tested this but the logic is described as

  • When the document sees the record finder form begin an ajax request
  • Extend the data of that request to include field values from the parent form