In my Grails application, I am using the following JavaScript function:
function sendPostRequest() {
var projectNameFilter = $("input[name='project-name-filter']").val();
var addressFilter = $("input[name='address-filter']").val();
$.post(
'${createLink(controller: "listing", action: "transactions")}',
{
projectNameFilter: eval(projectNameFilter),
addressFilter: eval(addressFilter),
listingType: "${params?.listingType}",
propertyType: "${params?.propertyType}",
},
function (data, status) {
$('#dynamic-table').html(data);
}
);
}
I want to highlight the two parameters:
- listingType: "${params?.listingType}"
- propertyType: "${params?.propertyType}"
In this function, there are multiple parameters that need to be passed to the controller. Is there a way to streamline this process and pass all the parameters at once?