I have a rather complex problem to the extreme. I need to somehow pass parameters dynamically to the params via javascript, to show / hide some fields in a report on user's request. Below is a screen representation:
I have a form where the user enters the data he wants in the search, with remote: true. Up there I have a container with a group of checkboxes, which is my problem at the moment. The below is where the results are loaded from a partial with a .js.erb file. It is important to mention that only this part recharges.
The box with the checkboxes, is not part of a form, and in my mind neither should. In JavaScript, I have an event attached to each checkbox. When each is deselected, the corresponding field in the result tables is hidden and a hidden field is created and dynamically inserted in the form there on the left. So I can send these parameters via url at the time of submit and hide these fields with a conditional giving a display: none on the lines where the parameter has a value of 1. This works if the user performs the filtering. But if it is not done, the parameters are not sent to the URL and when the pagination is done, the lines that should be hidden appear.
I would like to know if there is a way to send these parameters to the hash params dynamically via AJAX, so everything works correctly with or without filtering ...