silverstripe-reports/javascript/ReportAdmin.js

34 lines
776 B
JavaScript
Raw Normal View History

2013-01-17 01:22:13 +01:00
/**
* File: ReportAdmin.js
*/
(function ($) {
$.entwine("ss", function ($) {
$(".ReportAdmin .cms-edit-form").entwine({
onsubmit: function (e) {
let url = $.path.parseUrl(document.location.href).hrefNoSearch;
let params = this.find(":input[name^=filters]").serializeArray();
try {
params = $.grep(params, function (param) {
// filter out empty
return param.value;
});
// convert params to a query string
params = $.param(params);
// append query string to url
url += "?" + params;
$(".cms-container").loadPanel(url);
} catch (err) {
console.error(err);
}
return false;
},
});
});
2013-01-17 01:22:13 +01:00
})(jQuery);