Reverse initial sort order in multi record loader?

NickOg 16 Nov, 2011
Hi,

The multi record loader allows one to specify a sort order in the 'Order Fields' box. Is it possible to make that sort order be reversed? I want to specify the most recent dates - from newest down to oldest. I have seen the posts that explain how to sort via the header but it is the initial order that I would like to specify. Something like "-date,lastname,firstname"

Is that possible in any way? I have tried appending DESC but that didn't do the trick. I bet there is some way to do that that I haven;t thought of.

Regards

Nick
GreyHead 16 Nov, 2011
Hi Nick,

I tooks a quick look at the code and there is a direction parameter that is checked but no code box to input it.

Try adding a Custom action before the DB Multi Record Loader action (or a hidden input in your form) with
<?php
$form->data['direction'] = 'asc';
?>
but the code is a bit odd and it may need to be 'desc' in there ??

Bob
NickOg 16 Nov, 2011
Hi Bob,

That didn't fix it. I tried 'asc', 'desc', 'ASC' and 'DESC' in the custom code and in a hidden field and while the $form direction value did change it had no impact on the output.

Push comes to shove I can use a view that is sorted as I need it but if there is an option within chronoforms all the better of course.

Anything else I should try?

Chronoforms is one hell of a package! 😀 So much in there.

Thanks
GreyHead 01 Dec, 2011
Hi Nick,

I got this to work - but only by turning Pagination on. It seems that the Order by settings are ingnored if there is no pagination. ( A quirk I think, if not a bug.)

Bob
NickOg 06 Dec, 2011
Thanks Bob - I will try that out shortly. For the moment, I have use a view that is sorted to my needs.

Have you had trouble displaying a table using the 'All' Pagination button? It doesn't seem to work for me - it shows a blank screen.
jllav03 06 Dec, 2011
I too want to change the order of my ChronoConnectivity form. I have page pagination turned on in the footer, like so:

</table><br><br>{pagination}

What should the Order By syntax look like? This is what I have written under General > Query Related Settings > Order fields.

ORDER BY dmlastupdateon DESC

Thanks!

EDIT: I found this good how to doc, will see if that answers my question. Thanks
http://greyhead.net/how-to-docs/chronoconnectivity
GreyHead 07 Dec, 2011
Hi jllav03,

I think that is correct, if it doesn't work try it without the ORDER BY.

Bob
jllav03 07 Dec, 2011
Thanks, it worked without the Order By.

`dmlastupdateon` DESC
GreyHead 07 Dec, 2011
Hi Nick,

I haven't used the pagination much at all. A completely blank screen is usually a sign of a PHP error though.

Bob
NickOg 07 Dec, 2011
Hi Bob,

I will check that out. I do have display_errors on and didn't see anything reported.

Nick
This topic is locked and no more replies can be posted.