Forum
List Manager Support
List Manager supportForums
No se permite escribir sin estar logado. Por favor, login
Re: Require a filter before exporting 22.10.2015 11:56
Hi,
there is no configuration parameter for that purpouse. We think forcing a filter won't fully solve your problem because user can launch a filter that can exclude for ex just 100 or 200 records, thus not avoiding the mass export and your server timeout.
We suggest another approach instead, a good guess of how many records user is trying to export is the number of total pages * the number of records per page being shown, so you could add a simple js tweak with a limit on this number. This would be the code:
var numrecords=LMJQ("[id$='porpag']").val()*LMJQ("[id$='pagtotales']").html();
if(numrecords>1000){
alert("Your message here");
return true;
}
You can change the 1000 limit for the number of records you prefer
This tweak can be included at the beginning of the functions of the export buttons you're using
JOOMLA\modules\mod_listmanager\tmpl\content.php
LMJQ('..........exportexcelfiltered').click(function(e) {
//the code here
LMJQ('..........exportpdffiltered').click(function(e) {
//the code here
LMJQ('............exportrtffiltered').click(function(e) {
//the code here
etc.
It will restrict the filtered export to the number of records you configure, hope this will do the work for your case.
Regards
Moonsoft Team
www.moonsoft.es
there is no configuration parameter for that purpouse. We think forcing a filter won't fully solve your problem because user can launch a filter that can exclude for ex just 100 or 200 records, thus not avoiding the mass export and your server timeout.
We suggest another approach instead, a good guess of how many records user is trying to export is the number of total pages * the number of records per page being shown, so you could add a simple js tweak with a limit on this number. This would be the code:
var numrecords=LMJQ("[id$='porpag']").val()*LMJQ("[id$='pagtotales']").html();
if(numrecords>1000){
alert("Your message here");
return true;
}
You can change the 1000 limit for the number of records you prefer
This tweak can be included at the beginning of the functions of the export buttons you're using
JOOMLA\modules\mod_listmanager\tmpl\content.php
LMJQ('..........exportexcelfiltered').click(function(e) {
//the code here
LMJQ('..........exportpdffiltered').click(function(e) {
//the code here
LMJQ('............exportrtffiltered').click(function(e) {
//the code here
etc.
It will restrict the filtered export to the number of records you configure, hope this will do the work for your case.
Regards
Moonsoft Team
www.moonsoft.es