我正在使用编辑器的php库,
使用@SerializedName("abstract")
private String _abstract;
leftjoin()
如果我使用普通的编辑,一切都很好。
但是在冒泡编辑的情况下,只有第一个表的列(在我的情况下为$editor = Editor::inst(
$db,
'humans' , // Table name
'pid' // Primary key
)->fields(
Field::inst( 'humans.name' ),
Field::inst( 'students.email' ),
Field::inst( 'humans.phone' ),
// To get options
Field::inst( 'students.course' )
->options( Options::inst()
->table('courses')
->value('pid')
->label('name')
),
Field::inst( 'courses.name' )
)
->leftJoin( 'students', 'students.humanid', '=', 'humans.humanid' )
->leftJoin( 'courses', 'courses.pid', '=', 'students.course' )
->process( $_POST )
->json();
)会正确更新。如果我尝试更新课程,将无法正常工作
这是javascript和html
JavaScript
humans
HTML
editor = new $.fn.dataTable.Editor( {
ajax: {
url: "private/data.php",
data: {
key : "123"
},
type: "POST"
},
table: "#example",
fields: [ {
label: "Name:",
name: "humans.name"
}, {
label: "Phone:",
name: "humans.phone"
}, {
label: "Email:",
name: "students.email"
}, {
label: "Course:",
name: "students.course",
type: "select"
}
]
} );
$('#example').on( 'click', 'tbody td', function (e) {
editor.bubble( this );
} );
$('#example').DataTable( {
// serverSide: true,
dom: "Bfrtip",
ajax: {
url: "private/data.php",
data: {
key : "123"
},
type: "POST"
},
columns: [
{ data: "humans.name" },
{ data: "humans.phone" },
{ data: "students.email" },
{ data: "courses.name", editField: "students.course" }
],
select: true,
buttons: [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{ extend: "remove", editor: editor }
]
} );
有人可以帮助我弄清楚我在做什么错吗?