I want an FK field on a form to only list records created by the logged in user. This is working fine for filters, but seems to be missing from FK fields.
It is worth noting that this is one of my two remaining legacy projects (not ORM)
Here is what I have
<?php
// Associated Title
$field = $fieldSet['jform_associated_title'];
$field->jdomOptions = array(
'groupBy' => array(
'type' => 'type'
),
'created_by' => $this->item->created_by, /// THIS WAS ADDED BY ME
'list' => $this->lists['fk']['associated_title']
);
?>
<div class="control-group <?php echo 'field-' . $field->id . $field->responsive; ?>">
<div class="control-label">
<?php echo $field->label; ?>
</div>
<div class="controls">
<?php echo $field->input; ?>
</div>
</div>
<?php echo(MyComponentHelperHtmlValidator::loadValidator($field)); ?>
The cretaed by filter was added by me thinking it would work. but it doesnt. Is there an option I can use in the JDom options to filter the FK Select field (single choice) by the logged in users records like the filter dropdown does