Bubble or Inline Editing w/ Server Side Processing
Bubble or Inline Editing w/ Server Side Processing
Using server side code with joined tables and i'm curious if I'm seeing expected behavior or a problem hiding with my code. When clicking to edit, the existing value isn't there. If it's text, it's blank. If it's a select box, it's not selecting the existing option.
Also, the bigger problem is it's submitting the entire row of data, even though that option is not selected. I assume it has to do with using joined tables. This may be ok but since the existing selected values are not being selected it's submitting the wrong value of the select box.
Forgive the amateur coding skills.
editor = new $.fn.dataTable.Editor( {
ajax: "./cmsUpdateOrder.php?dowhat=dashboardfieldupdate",
table: "#openorders",
fields: [ {
label: "Contractor:",
name: "CMS_workorders.ContractorId",
type: "select",
options: [
<?
foreach ($clist as $c) {
print "{ label: '$c[fullname]', value: '$c[userid]' },";
}
<?php
>
{ label: "Unassigned", value: "0" }
]
}, {
label: "Crew:",
name: "CMS_workorders.crew"
}, {
label: "Status:",
name: "CMS_workorders.status"
}
]
} );
?>
// Activate an inline edit on click of a table cell
$('#openorders').on( 'click', 'tbody td.ooeditable', function (e) {
editor.bubble( this );
} );
Answers
Hi,
My guess is that you are showing a label in the table rather than
CMS_workorders.ContractorId
- is that correct? Are you usingcolumns.editField
to tell Editor that name of the field you want to edit from the table (i.e. the id rather than the label)?If you are able to give me a link to the page I can check for sure.
Allan