Quantcast
Channel: DataTables 1.10 — DataTables forums
Viewing all articles
Browse latest Browse all 2364

Standalone Editor idSrc

$
0
0

Hello,

I've become a huge fan of DataTables and I'm using extensively in a project with many editable tables. I like it so much, that I want to use the Standalone Editor for a couple of sections.

Is there an idSrc option when using the Standalone Editor, or another way to do something similar? Obviously, I don't want the ID field to be editable. Should idSrc work with the Standalone Editor, or do I need to find another way to send the ID with the request?

I have the following code:

dd_editor = new $.fn.dataTable.Editor( { 
        ajax: "/orders/_com/json.cfc?method=editJson&Com=Order&Req=OrderMaster",
        idSrc: "id",
        fields: [{
            name: "id" // IDEALLY THIS FIELD WILL NOT BE HERE
            }, {
                name: "client_po_number"
            }, {
                name: "payment_status",
                type:  "select",
                options: [ "Not Due and Unpaid","Due and Unpaid","Paid","Cancelled" ]
            }, {
                name: "submitted",
                type:  "select",
                options: [ "In Process","Completed","Cancelled" ]
            }, {
                name: "orderduedate"
            }, {
                name: "billingdate"
            }, {
                name: "comments"
            }
        ]
    } );

Response:

action:edit
data[id]:21 //Should not appear here, either.
data[client_po_number]:12345
data[payment_status]:Paid
data[submitted]:Completed
data[orderduedate]:05/10/2011
data[billingdate]:01/01/1970
data[comments]:edited 3

In my response, I am receiving the data array, but the "id" field does not appear outside of data[]. If I'm using idSrc in a standard table implementation, the "id" field does appear.

Note: Currently, the ID field appears on the form (which is why it's in the fields set above), but I need a way to hide it so that it's not accidentally changed.

Any assistance or clarification on the issue is greatly appreciated. Thank you!


Viewing all articles
Browse latest Browse all 2364

Trending Articles