Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81916

Bubble or Inline Editing w/ Server Side Processing

$
0
0

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]' },";
            }
?>
                    { 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 );
    } );

Viewing all articles
Browse latest Browse all 81916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>