2

enter image description here

Imagine that I have a relation field, and I want to store that relation and also an atribute name of the chosen relation into a hidden input.

Example: Into a relaion field I choose a project with name "Something Cool", I want to store "Something Cool" into the hidden input info.

How can I do that?

(I need that because of a sorting... I can't access to a relation)enter image description here

Ivan
  • 514
  • 5
  • 21

1 Answers1

2

You could use the dependsOn option for the field to set the value described here:

project_id:
    label: Projecto
    type: relation
    nameFrom: name
sorting_field:
    type: text
    dependsOn: project_id
    cssClass: hidden # this is a helper class from storm.css to set the visibility to hidden

And the set the value in the fitlerFields() function described here

dragontree
  • 1,709
  • 11
  • 14