Hi Max,
In Chrono Connectivity v5 is it possible to filter by a range of results, ideally I would like to have a select box for minimum (number) and another select select box for maximum (number) and then return all the results in between?
Hi Edworthy,
Just use this code in your conditions box after you do the necessary adjustments to the Mode, field, min and max:
return array("Model.field >=" => \GCore\Libs\Request::data("min"), "Model.field <=" => \GCore\Libs\Request::data("max"));
Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Thanks Max,
If I understand this correctly it will filter the results when the connection is made. Is it possible to filter by a range of results after the connection is made?
I would like to show all entries when they first open the connection and then have the option to filter using minimum and maximum select boxes or input boxes similar to fltr[Model][field].
Well, Just put the whole code inside an if statement:
if(\GCore\Libs\Request::data("min")){
//return your conditions here
}
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Your fields code should go in the "header" section, and the first code chunk should go in the "Conditions" box under "models", just make sure it has a starting php tag first: <?php
Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
If the value is part of a string (JSON string) inside a field then I have no idea how to make this comparison, you usually use the full field value for comparison.
If you can move all your encoded parameters into a new table (multiple fields) with a foreign key pointing to the main table then you can setup a "hasOne" relation and get it to work.
Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
I figured out how to display the timestamp as a standard date, but can someone please help me with how to filter with a range of dates??
Thanks
AK