Hi๐
I have table with many GROUPS. I need to use SELECT menu to choose GROUP... Than I need to send this WHERE condition to this same ChornoConnectvity and show table with only selected GROUP.
I have table with many GROUPS. I need to use SELECT menu to choose GROUP... Than I need to send this WHERE condition to this same ChornoConnectvity and show table with only selected GROUP.

Hi ynternet,
I know that this is possible because that's how the Category drop-down in the FAQs list here works. But I'm not clear how Max set it up. I know that it uses a ChronoForm 'task' for the search box and the Category.id is used as a filter but not much more than that.
Hopefully Max will be able to explain more.
Bob
I know that this is possible because that's how the Category drop-down in the FAQs list here works. But I'm not clear how Max set it up. I know that it uses a ChronoForm 'task' for the search box and the Category.id is used as a filter but not much more than that.
Hopefully Max will be able to explain more.
Bob
Hello,
You will need to enter the "Group" column name (in the database table) in the "Filters fields names" box under the "Search settings" tab, please follow the instructions under the box there, so ify our "Group" column is called "group" then the filter field name (the dropdown in your case) should be:
filter_group
and if you have a model name XYZ then the name should be:
filter_xyz_group
I hope this helps!๐
Regards,
Max
You will need to enter the "Group" column name (in the database table) in the "Filters fields names" box under the "Search settings" tab, please follow the instructions under the box there, so ify our "Group" column is called "group" then the filter field name (the dropdown in your case) should be:
filter_group
and if you have a model name XYZ then the name should be:
filter_xyz_group
I hope this helps!๐
Regards,
Max
Thank you Max and Bob.
I have in "Custom listing settings" in HEAD:
in "Filters fields names" in "Search settings" filter_group
in "General" in "WHERE SQL" :
When I select some group (for example group number 1), it works and just group number 1 is in the table. But when I try sort some column (for examle cf_UID) - "sort" works, but SELECT menu does not work. Every group from database are in the ChronoConnectivity table.
I have in "Custom listing settings" in HEAD:
<script>
window.addEvent('domready', function() {
$('filter_group').addEvent('change', function() {
var group = $('filter_group').value;
window.location = '?filter_group='+ group;
});
});
</script>
<?php
$db2 =& JFactory::getDBO();
$query2 = "SELECT DISTINCT `group_name`,`CF_ID` AS `ID`
FROM `#__chronoforms_data_groups`
ORDER BY `CF_ID`;
";
$db2->setQuery($query2);
$data2 = $db2->loadObjectList();
?>
<form action="groups/group-list" method="post" name="form2">
<label for="filter_group">Group :</label>
<select size="1" type="select" name="filter_group" id="filter_group" >
<option value="all">All groups</option>
<?php
$get_group = JRequest::getString('filter_group', '', 'get');
foreach ( $data2 as $d2 ) {
$selected = ($d2->ID == $get_group) ? "selected" : "";
echo "<option value='".$d2->ID."' ".$selected.">".$d2->group_name."</option>";
}
?>
</select>
</form>
in "Filters fields names" in "Search settings" filter_group
in "General" in "WHERE SQL" :
<?php
$where_group = JRequest::getString('filter_group', '', 'get');
if ( $where_group && $where_group != 'all') {
echo "`group_name` = '$where_group' ";
}
?>
When I select some group (for example group number 1), it works and just group number 1 is in the table. But when I try sort some column (for examle cf_UID) - "sort" works, but SELECT menu does not work. Every group from database are in the ChronoConnectivity table.
I have yet another one problem with this ChronoConnectivity table.
In the "Footer" i have this code :
But pagination is not working...
In the "Footer" i have this code :
</tbody>
</table>
{pagination}
But pagination is not working...
Hi ynternet,
I'm not sure about the filter problem but I think the pagination is now {paginator}
Bob
I'm not sure about the filter problem but I think the pagination is now {paginator}
Bob
Thanx Bob, paginator works fine...
So with problem with filter, we have to wait for Max.๐
So with problem with filter, we have to wait for Max.๐
Hi,
The core filters work when used with fixed where SQL, I'm not sure if its going to work after adding extra conditions to the WHERE statement using PHP๐
also the filters fields names box should take the table's columns names to be filtered, not the fields names, a bit misleading, sorry!
Regards,
Max
The core filters work when used with fixed where SQL, I'm not sure if its going to work after adding extra conditions to the WHERE statement using PHP๐
also the filters fields names box should take the table's columns names to be filtered, not the fields names, a bit misleading, sorry!
Regards,
Max
Thank you Bob and Max,
I have another problem...
I have defined object $data2 in the "HEAD" :
But when I use this in the "BODY"
It seem to me, that there is no object $data2 in the BODY. Is there some solution to pass object, variable, array or somethig from HEAD to BODY ?
I have another problem...
I have defined object $data2 in the "HEAD" :
$data2 = $db2->loadObjectList();
But when I use this in the "BODY"
echo $data2[0]->group_name;
echo $data2[1]->group_name;
echo $data2[2]->group_name;
It seem to me, that there is no object $data2 in the BODY. Is there some solution to pass object, variable, array or somethig from HEAD to BODY ?
Hi ynternet,
You have a 'scope' problem here. When you define a variable in the Head box it is only valid in that box. You need to define it as global before it is set to make it available in the body box.
Bob
You have a 'scope' problem here. When you define a variable in the Head box it is only valid in that box. You need to define it as global before it is set to make it available in the body box.
<?php
global $data2;
. . .
$data2 = $db2->loadObjectList();
. . .
?>
<?php
global $data2;
. . .
echo $data2[0]->group_name;
echo $data2[1]->group_name;
echo $data2[2]->group_name;
. . .
?>
Bob
This topic is locked and no more replies can be posted.