Hi all,
Sorry for bringing this up.
I followed the instructions described in this thread and everything work when customizing the labelKey with multiple data entry.
Anyhow, I can't find a way to insert a function inside labelKey.
I am trying to mimic this code (from com_category) that shows a list-combo with category names and a number of "-" that reflects the category level (a property present in the array showing the category name):
$options[$i]->text = str_repeat('- ', $options[$i]->level). $options[$i]->text ;
Now, inside jdom list, this works:
$field = $fieldSet['jform_parent_id'];
$respar=$this->lists['fk']['parent_id'];
$field->jdomOptions = array(
'list' => $this->lists['fk']['parent_id'],
'groupBy' => array(
'el_ref' => 'el_ref'
),
'labelKey' => str_repeat('- ',2) . "{el_ref}"
);
But I can't find a way to replace the fixed number 2 with the propery level.
This shows correctly the level value for each element:
$field = $fieldSet['jform_parent_id'];
$respar=$this->lists['fk']['parent_id'];
$field->jdomOptions = array(
'list' => $this->lists['fk']['parent_id'],
'groupBy' => array(
'el_ref' => 'el_ref'
),
'labelKey' => "{level} {el_ref}"
);
But I can't input {level} inside the str_repeat function. The following outputs the function as normal echoed text, followed by the level value:
$field = $fieldSet['jform_parent_id'];
$respar=$this->lists['fk']['parent_id'];
$field->jdomOptions = array(
'list' => $this->lists['fk']['parent_id'],
'groupBy' => array(
'el_ref' => 'el_ref'
),
'labelKey' => "str_repeat('- ',{level}) {el_ref}"
);
So, how can I enter a function inside my labelKey value ?
Thanks
Elena