remove: function (event, fm) {
event.data.removed[0].name
}
I need the name of the file that was removed
@hiagobury Catch the exec event and obtain the file which will be deleted in advance.
var staged = {};
var elf = $('#elfinder').elfinder('instance');
elf.bind('exec', function(e, fm) {
if (e.data.cmd === 'rm') {
staged = {};
$.each(e.data.files || fm.selected(), function(i, h) {
staged[h] = fm.file(h);
});
}
});
elf.bind('remove', function(e, fm) {
var names;
if (e.data.removed.length) {
names = $.map(e.data.removed, function(h) {
return staged[h]? staged[h].name : null;
});
fm.log(names);
}
});
thank you very much
e.data.files is undefined =(
@hiagobury Sorry, please use e.data.files || fm.selected(). I edited previous comment.
everything perfect, I was letting something happen at the beginning of the file your solution is fine, thank you