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

Update datatable with select field

$
0
0

I have a object like

function a(opts)
{
this.opts = opts;
}

in my editor I use it as

var test= new $.fn.dataTable.Editor( {
        table: "#test",
            idSrc:  'id',
        fields: [ {
                            label: "Test:",
                            name: "opts.id",
                            type: "select",
                            ipOpts: getData()
       }]
});

and the datatable display it as

var testTable = $('#test).DataTable({
        dom: "Bfrtip",
        data: [ getDataList() ],
        columns: [  { data: 'opts.label', title: "opts label" } ],
        select: true,
        buttons: [
            { extend: "create", editor: test},
            { extend: "edit", editor: test},
            { extend: "remove", editor: test}
        ]
    });

when I edit the data, the display will become null, how can I replace opts.label as the select label and opts.id as select value?


Viewing all articles
Browse latest Browse all 82213

Trending Articles



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