More code for Export to Toolbar
File .../administrator/components/com_jem/views/attendees/tmpl/default.php
Add this in the top of the file
JFactory::getDocument()->addScriptDeclaration('
Joomla.submitbutton = function(task)
{
document.adminForm.task.value=task;
if (task == "attendees.export") {
Joomla.submitform(task, document.getElementById("adminForm"));
document.adminForm.task.value="";
} else {
Joomla.submitform(task, document.getElementById("adminForm"));
}
};
');
so it will look like
defined('_JEXEC') or die;
JHtml::_('behavior.tooltip');
$colspan = ($this->event->waitinglist ? 10 : 9);
JFactory::getDocument()->addScriptDeclaration('
Joomla.submitbutton = function(task)
{
document.adminForm.task.value=task;
if (task == "attendees.export") {
Joomla.submitform(task, document.getElementById("adminForm"));
document.adminForm.task.value="";
} else {
Joomla.submitform(task, document.getElementById("adminForm"));
}
};
');
?>
<form action="<?php echo JRoute::_('index.php?option=com_jem&view=attendees'); ?>" method="post" name="adminForm" id="adminForm">
<table class="adminlist">
The thing here was that the task value wasn't blanked when we are pressing the export button and doing so it had problems.
For example: when the above code wasn't inserted. Press export and go to next page of results. It will trigger the export again.
The code above will blank the task value when the export button is pressed and doing so it should be working ok.