Quantcast
Channel: Editor — DataTables forums
Viewing all articles
Browse latest Browse all 3740

Deleting values when editing

$
0
0

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)
            )
    )

Viewing all articles
Browse latest Browse all 3740