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

Inline Editor UploadMany Delete Button Not Working?

$
0
0

I have an UploadMany that doesn't appear to fire a callback thru AJAX when an item is "Deleted" (X clicked on the right):

            editor = new $.fn.dataTable.Editor(
                {
                    ajax: { 
                        data: 
                        function(d) {
                            d.DT_RowID = editor.ids();
                        },
                        type: "POST",
                        url: "/AudioClips/Edit"
                    },
                    idSrc: "id",
                    table: "#Table_be6112dc6271436db5230ee7143273b7",
                    fields: [
                        {
                            name: "name",
                            label: "Name"
                        },
                        {
                            name: "clips",
                            label: "Audio Clip",
                            type: "uploadMany",
                            noFileText: "No Clips Uploaded.",
                            display: function (file)
                            {
                                if(file.fullyQualifiedID)
                                    return '<audio controls src="/AudioClips/Clip/?source=' + file.fullyQualifiedID + '" />';
                                else
                                    return '<audio controls src="/AudioClips/Clip/?source=' + editor.ids() + '_' + file + '" />';
                            }
                        }
                    ]
            } );

            $('#Table_be6112dc6271436db5230ee7143273b7').on('click', 'tbody td.dt-editable', function (e)
            {
                editor.inline(this);
            } );

    var dataTable = $("#Table_be6112dc6271436db5230ee7143273b7").DataTable(
        {
            processing: true,
            serverSide: true,
            filter: true,
            order: [0, 'asc'],
            orderMulti: false,
            ajax: {
                url: "/AudioClips/Items?id=2dac5d78-3373-47cf-815a-4cd8e9b78c3e",
                type: "POST",
                datatype: "json"
            },
            columns: [
                {
                    className: "dt-editable",
                    data: "name",
                    name: "Name",
                    autoWidth: true
                },
                {
                    className: "dt-editable",
                    data: "clips",
                    name: "Audio Clip",
                    render: function (d)
                    {
                        if (d.length)
                        {
                            return "<button class=\"btn btn-sm btn-outline-secondary dt-editable\">" + d.length + " Clips</button>";
                        }

                        return  "No Clips Uploaded.";
                    },
                    autoWidth: true,
                },
                {
                    data: "hasChildren",
                    name: "Is Variable?",
                    autoWidth: true
                },
                {
                    data: "id",
                    orderable: false,
                    render: function (data, type, row, meta)
                    {
                        return '<button class=\"btn btn-sm btn-outline-success Table_be6112dc6271436db5230ee7143273b7-details\">Details</Button>&nbsp;<button class="btn btn-sm btn-outline-danger" onclick="DeleteAudioClip(\''+data+'\');">Delete</button>';
                    }
                }]
        });

I'm getting not JS errors in Chrome and the break-point for the ajax() call in the editor itself is not being hit. I was curious if it was, perhaps, an issue with losing focus (I know that sometimes things don't update until focus is lost), but the break-point is still never hit and the server doesn't seem to get any calls either (from verbose logging).

It's fine if I need to tie into a custom parameter or something -- I just need to know what's up.


Viewing all articles
Browse latest Browse all 82145

Trending Articles