-
- 120 Posts
Dear Bruno,
there is a way to process migx fields at the time when I press Done?
I have two fields from which I would like to generate the content of the third.
Thank you.
[ed. note: ferx77 last edited this post 7 years ago.]
FerX - Developer at Eracom s.r.l.
-
- 5,888 Posts
Could you explain in more detail with an example, what you are after?
-
- 120 Posts
Thanks Bruno.
I propose a simple example, although my use is much more complex.
fields:
name: text
surname: text
name_surname: hidden
I need that when you click on done is run a snippet that can process fields.
es.
<?php
$fields=$input;
$fields["name_surname"]=ucfirst(strtolower($fields["name"]." ".$fields["surname"]));
return $fields;
I repeat, this is just a simple example, but the processing of which I need is more complex.
It is not only rendering for columns, but normalize and complete certain fields.
FerX - Developer at Eracom s.r.l.
-
- 120 Posts
practically the "this.RenderChunk" function for the columns, but for create and modify fields.
FerX - Developer at Eracom s.r.l.
-
- 5,888 Posts
doesn't the renderChunk - renderer do this allready? (modifying the field)
-
- 120 Posts
how do I solve the example I presented?
FerX - Developer at Eracom s.r.l.
discuss.answer
-
- 5,888 Posts
you could put in the renderchunk - tpl a snippet and pass the fields with the properties or you could use output-filters in the renderchunk - tpl like
[[+name:lowercase:ucfirst]] [[+surname:lowercase:ucfirst]]
the fieldname for the column would be name_surname, in this case
-
- 120 Posts
ok. thank you. I had not realized that render chunk overwrites the data.
FerX - Developer at Eracom s.r.l.
-
- 5,888 Posts
yeah, this is a sideeffect of the renderchunk - renderer, if used with a MIGX-TV/MIGX-field.