Deleting values when editing
Deleting values when editing
Hey Guys,
i have a 1:n relationship and using JOIN class. Everything works fine. The values from the joined table i just want to display, so i don't added them in the "fields" part of "editor = new $.fn.dataTable.Editor( {" After editing a value from the parent join table, the values from the joined tables are deleted / empty. So i tried to use "->set(false)" but made no difference.
I am doing an n:m join too and here it works perfect, even without "->set(false)"
I also tried to set the field type "readonly". In this case i got an error "update is not a function".
Can anyone help me?
Editor::inst( $db, 'abs', 'abs.id' )
// Editor::inst( $db, 'abs')
->fields(
Field::inst( 'abs.id' ),
Field::inst( 'abs.number' )->validator( 'Validate::notEmpty' ),
)
->join(
Join::inst( 'block', 'array' )
->join( 'id', 'blockAbId' )
->fields(
Field::inst( 'blockId' )
->validator( 'Validate::required' )
->options( 'block', 'blockId', 'blocknummer' )->set(false),
Field::inst( 'blocknummer' )->set(false)
//,
)
)
->join(
Join::inst( 'delivery', 'array' )
->join(
array( 'abId', 'abId' ),
array( 'deliveryId', 'deliveryId' ),
'abDelivery'
)
->fields(
Field::inst( 'deliveryId' )
->validator( 'Validate::required' )
->options( 'delivery', 'deliveryId', 'bezeichnung' )
->set(false),
Field::inst( 'bezeichnung' )
->set(false),
Field::inst( 'betrag' )
->set(false)
)
)
This question has an accepted answers - jump to answer
Answers
Ok fixed it :) The solution was to add "->set(false)" for the JOIN::inst and not for every field in "->fields".
It should look like this
Hi,
Good to hear you found the solution. Thanks for posting back.
Allan