This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Editing pivot fields before the relation is made is kinda hard. So it's best to hide pivot fields when in the "creation" stage of a relation and to show them when updating that relation table
Using this little trick, to trigger on the model id, you can easely only show them when the relation is set :-)
pivot[sortorder]:
label: sortorder
trigger:
action: hide
field: pivot[id]
condition: value[0]
pivot[id]:
hidden: true;
disabled: true;
default: 0
Please keep in mind that this only works if you also create an auto incrementing id column in your pivot table.
Last updated
or you can simply use the context attribute, in your case it will be :
fieldname: context: update
or
fieldname@update:
o_O ... heads to documentation
that would have saved me so much time...
grmzhlz
I totally missed that in the documentation....
o_O ... heads to documentation
that would have saved me so much time...
grmzhlz
I totally missed that in the documentation....
1-4 of 4