Inserting elements in the middle

marcolino21

New Member
(Please, urgently)
Hi,
I want to put an element in the middle after a certain field, how am I doing?
Example : I'want to insert a field pippo after field textarea "Pluto" (5? field)
Thank you

bye
 
Last edited:
For "urgent" questions you should consider to take a subscription.

You can order your elements by clicking on the two arrows (beside ID) in the element list, then drag and drop.
 
I shared the same problem and found no luck fixing the issue. I hope that the fabrik team would help seeing this problem.
Current context: There are elements generated by a joined list. For example Table 1: ID, Name, Address, Position and table 2: Phone
For some reason, I would like the list to show with following order:
ID, Name, Address, Phone, Position
>> Phone must be in between Address and Position.
Problem: I tried to modify order in element list but this does not work at all.
Could you please be so kind guiding me to help this matter with thanks.
(I found list.php in helpers
Code:
public static function getElements($listModel, $filter = array())
    {
        $found = array();
        $groups = $listModel->getFormGroupElementData();

        foreach ($groups as $groupModel)
        {
            $elementModels = $groupModel->getMyElements();

            foreach ($elementModels as $elementModel)
            {
                $item = $elementModel->getElement();
                $ok = true;

                foreach ($filter as $key => $val)
                {
                    if ($item->$key != $val)
                    {
                        $ok = false;
                    }
                }

                if ($ok)
                {
                    $found[] = $elementModel;
                }
            }
        }

        if (empty($found))
        {
            $filterNames = implode(', ', $filter);
            throw new Exception(JText::sprintf('COM_FABRIK_ERR_NO_ELEMENTS_MATCHED_FILTER', $filterNames));
        }

        return $found;
    }
And from reading the code I found that the author group and set element order by group that link to each table.
If yes, the only way to make such order insertion work is to modify the above code.
Can you please help me with thanks.
Yours very faithfully
Dang Dinh Ngoc - Vietnam
 
This isn't the kind of assistance we can provide in the free Community forum.

-- hugh
Hi Hugh,
After sometimes trying to read php, I have done one for myself and this work fined to my requirement. Moving from VBA to Php is a nightmare but good fun and I hope I can do a little more to not causing too much newbie question on you!
Dang Dinh Ngoc - Vietnam
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top