Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35273

How can I populate a dropdown for my editable DataTable?

$
0
0

I'm doing this:

   editor = new $.fn.dataTable.Editor({
        ajax: 'url',
        table: '#invDetailsTable',
        fields: [{
            label: "Location",
            name: "location",
            type: "select",
            options: locationList
        }]
    });

locationList is just an array of objects with {label: 'name', value: 0} as the objects. The table comes up and it looks like a dropdown but there are no items in the list. Is there something else I need to do to populate the dropdown? This is all I found in the documentation... I tried it with a list I feed directly to the fields parameter like this:

            options: [
                { label: "To do", value: 0 },
                { label: "Done",  value: 1 }
            ],

but had the same result.

Any ideas would be much appreciated!


Viewing all articles
Browse latest Browse all 35273

Trending Articles