pagination

?
Guest 29 Aug, 2011
hi all,

I am currently playing around with the latest CF4 RC 2.0, namely trying to figure out how I need to adjust my 'old' forms for making the new pagination feature in the multi record loader work

my custom code for displaying data is looking like this:

<form action="<?php echo JRoute::_('index.php?option=com_content&Itemid=19&catid=5&id=10&view=article'); ?>" name="somename" method="post">
	
<?php foreach ($form->data['Results'] as $detail): ?>
<div class="someclass">
	some display rules
</div>
<?php endforeach; ?>

<?php
$database =& JFactory::getDBO();
$limit = 15;
$database->setQuery("SELECT COUNT(*) AS total FROM #__chronoforms_data_something WHERE someconditionismet");
$total = $database->loadResult();
$limitstart=JRequest::getVar('limitstart', '0', 'get');
jimport('joomla.html.pagination');
$pageNav = new JPagination($total, $limitstart, $limit); 

if ($total > $limit) : ?>
	<div class="list-footer">
  		<?php
  		echo $pageNav->getPagesLinks();
  		echo $pageNav->getPagesCounter();
  		?>
  	</div>
<?php endif; ?>
</form>


that form works with pagination disabled in the db loader , but when removing the pagination code from custom elements and enabling pagination in the db loader I get a no results message returned.

could you please provide a hint on how to adjust this ?
Max_admin 30 Aug, 2011
Hi Gabriela,

Assuming that you are using the data loaded through the "multi db record loader" action itself and not your custom queries then you should add the line of code below to a custom code action AFTER the "DBMRL" is called and you should get the pagination:

<?php echo $form->paginatior_footer; ?>


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
?
Guest 30 Aug, 2011
hi Max,

I am sorry but I seem to not having expressed myself clearly.
the display of pagination (DBMRL) is working

but - while there are records (plus pagination) displayed with my old setup - once I enable pagination in DBMRL instead of the records the message set for the on empty result ("no records found") would be triggered

also how could I enter a WHERE condition when calculationg $total for the pagination?
Max_admin 30 Aug, 2011
Hi Gabriela,

I suggest that you ignore your old setup and use the new setup, just setup the action so that it displays your desired records (with or without WHERE) and list all your records using PHP code (as per the tutorial in our Tutorials page) and you may then enable or disable the pagination.

Am I missing something ? does your old setup do anything which can't be done with the new easy way provided by the new version ?

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
?
Guest 30 Aug, 2011
ahhh found it! was something in the where clause of the loader that once removed fixes the matter
This topic is locked and no more replies can be posted.