File Drop on a table row no more working ? [message #1847291] |
Thu, 21 October 2021 20:14 |
Michel R Messages: 46 Registered: April 2015 |
Member |
|
|
Hello,
I just upgraded my Scout application from Scout 10 to Scout 11. I use the Java environment.
I use the file drop feature on Table Pages, both on rows and on empty space.
When I drop the file on a row, I expect to get the target row in my application. It used to work with Scout 10.
After the upgrade to Scout 11, it doesn't work anymore.
I did some debugging, firstly in the Java application, then in the browser.
What I see is that the 'rowId' property is empty in the uploadProperties variable in JsonTable.consumeBinaryResource.
I checked what happens in Table.js, I see this:
_createDragAndDropHandler() {
return dragAndDrop.handler(this, {
supportedScoutTypes: dragAndDrop.SCOUT_TYPES.FILE_TRANSFER,
onDrop: event => this.trigger('drop', event),
dropType: () => this.dropType,
dropMaximumSize: () => this.dropMaximumSize,
additionalDropProperties: event => {
let $target = $(event.currentTarget);
let properties = {
rowId: ''
};
if ($target.hasClass('table-row')) { // <=== issue here
let row = $target.data('row');
properties.rowId = row.id;
}
return properties;
}
});
}
The indicated line is where it fails. The target has no 'table-row' class, because at this point it is the table itself, not the row. So the rowId property remains an empty string. Anyway, since it is not a row, the target has no 'row' property.
additionalDropProperties
<this>: {...}
$target: {...}
0: div.table.detail-table.parts-page.view
length: 1
<prototype>: {...}
Should I change something when I build my table so that the row can be the target of the drop ? It worked before... Or what can I do ? Is it a bug ?
Thank you.
Michael.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03993 seconds