how to set id on master/detail?
how to set id on master/detail?
muratkasikcioglu
Posts: 4Questions: 1Answers: 0
I'm making a form as master/detail. Before open the form, I create a new master_id to use on detail datatables. How can I set related master_id on detail?
This discussion has been closed.
Answers
Hi @muratkasikcioglu ,
This example here may help, it shows how to use a row ID. If that doesn't get you going, it would if you could post your code too.
Cheers,
Colin
JS
var editor;
PHP
<?php
ob_start();
session_start();
/*
* Example PHP implementation used for the index.html example
*/
// DataTables PHP library
include( "editor/php/DataTables.php" );
// Alias Editor classes so they are easy to use
use
DataTables\Editor,
DataTables\Editor\Field,
DataTables\Editor\Format,
DataTables\Editor\Mjoin,
DataTables\Editor\Options,
DataTables\Editor\Upload,
DataTables\Editor\Validate,
DataTables\Editor\ValidateOptions;
// Build our Editor instance and process the data coming from _POST
Editor::inst( $db, 'proposal_item' )
->debug( true )
->fields(
Field::inst( 'proposal_item.proposal_id' ),
Field::inst( 'proposal_item.product_id' )
->options( Options::inst()
->table( 'product' )
->value( 'id' )
->label( 'title_tr' )
)
->validator( Validate::dbValues() ),
Field::inst( 'product.title_tr' ),
I found a way. Maybe helps some one.
Please look at "preCreate" on server side: