• Payment Plugins Poll

    We need your feedback on the need for updated payment plugins. Please go here and give us your feedback.

  • Joomla 5.1

    For running J!5.1 you must install Fabrik 4.1
    See also Announcements

  • Subscription and download (Fabrik 4.1 for J!4.2+ and J!5.1) are working now

    See Announcement
    Please post subscription questions and issues here

    We have resolved the issue with the J! updater and this will be fixed in the next release.

Advise on how to syntax to display calc data in a dropdown menu for selection

molcomp

Member
Hi,

My data from calc field are currently display in a text list

$rows = $myDb->loadObjectList();
$list = array();
foreach ($rows as $row)

{
$list[] = "<li>" . $row->subactivity_name . "</li>";
}


I need to list the data in a dropdown so I can select an option. I tried some php coding but obviously I am missing some syntax in terms of fabrik or joomla for the calc field.

Any advise or direction in resolving it is much appreciated.

Thanks
Alex
 
Instead of a calc use a dropdown element with "Eval populate"
 
Hello @troester

I did manage to the above with the calc field but I am having some issues with it CSS so I thought trying your suggetion with the dropdown. However I am having some syntax error with the data-where sql clause. Can you please tell me what's wrong with the following syntax in data-where clause under dropdown menu. As far as I could understand from wiki and forum question this should be it but its not since I get an error.

WHERE {thistable}.`subactivity_name`
IN
(
select array('subactivity.subactivity_name') from 'subactivity'
join 'INNER', 'intemgroup1 ON intemgroup1.subactivity_name=subactivity.id'
join 'INNER', 'projects ON projects.id=intemgroup1.project_name'
join 'INNER', 'activities ON activities.id=intemgroup1.activity_name'
where 'projects.project_name = ' . $myDb->quote('{overlapping___project_1}')
where 'activities.activity_name = ' . $myDb->quote('{overlapping___activity_1}')
)

Following is my query in the calc field that works.
$myQuery
->select(array('subactivity.subactivity_name'))
->from('subactivity')
->join('INNER', 'intemgroup1 ON intemgroup1.subactivity_name=subactivity.id')
->join('INNER', 'projects ON projects.id=intemgroup1.project_name')
->join('INNER', 'activities ON activities.id=intemgroup1.activity_name')
->where('projects.project_name = ' . $myDb->quote('{overlapping___project_1}') )
->where('activities.activity_name = ' . $myDb->quote('{overlapping___activity_1}'));

Thank you very much @troester if you can help or point to direction how to resolve it.

Alex
 

Members online

No members online now.
Back
Top