Setformatter doesn`t work with fields from leftjoin
Setformatter doesn`t work with fields from leftjoin
jgcaudet
Posts: 82Questions: 7Answers: 0
Hi Allan
Why it doesn´t work this :
$editor = Editor::inst( $db, 'partsdetail', 'pardetid')
->fields(...
Field::inst( 'partsdetail.modifiedby' )
->setFormatter( function($val, $data, $field) {
$pModifiedby = "allan" ;
return $pModifiedby;
}), ....
Field::inst( 'parts.customer' )->set(false), ....
->leftJoin( 'parts', 'parts.parid', '=', 'partsdetail.parid' )
Simply doesn´t modify 'partsdetail.modifiedby' value.
Thanks
Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Is
partsdetail.modifiedby
being submitted by the client-side? If not, you need to use theField->setValue()
method to set the value (the formatter is used to transform one form into another).Allan