Editor Upload behaviour

Editor Upload behaviour

redbaronredbaron Posts: 12Questions: 6Answers: 1

Using the example located here: https://editor.datatables.net/examples/advanced/upload.html I have noticed a problem with the UI behavior.

If you edit a record, choose a file, then clear the file, and re-select the same file, it does not appear in the list as having been selected.

In my production application this behavior is the same, and I am trying to figure out what I need to change for it to properly show the image that may have already been cached by the server by a prior request.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,920Questions: 1Answers: 10,152 Site admin
    Answer ✓

    Hi,

    Thanks for letting me know about this. It is being caused by listening for the change event, but if you select the same file again, then the value doesn't change and thus the upload action doesn't happen.

    I've committed fix for this which will be in 1.5.6 to be released next week. In the mean time, if you want to make the change locally, find the line:

    Editor.upload( editor, conf, this.files, _buttonText, dropCallback );
    

    and replace with:

            Editor.upload( editor, conf, this.files, _buttonText, function (ids) {
                dropCallback.call( editor, ids );
                container.find('input[type=file]').val('');
            } );
    

    Regards,
    Allan

This discussion has been closed.