Opened 8 years ago

Closed 8 years ago

#12549 closed defect (fixed)

Enhanced grid drag and drop, doesn't drop in another empty grid

Reported by: ilona_oud Owned by: evan
Priority: high Milestone: 1.7
Component: DojoX Grid Version: 1.6.0
Keywords: Cc:
Blocked By: Blocking:

Description

Hello,

I would like to make a two list selector. The list on the left (Enhanced grid with one column) has data which you can choose from. This data can be dragged to the list on the right wich has no data yet. If I drag an item to the right, the following error occurs:

In Chrome:

DnD._markTargetAnchor() error: TypeError?: Cannot call method 'getBoundingClientRect' of null

In Firefox:

DnD._markTargetAnchor() error: TypeError?: node is null

This occurs because the _markTargetAnchor function in DnD.js determines the position of the item (where you want to drop it) depending on cells in the destination grid. Which aren't there... I wanted to move a row so the function _calcRowTargetAnchorPos fails on dojo.position(cell.getNode(rowIndex)); (row number 512 in DnD.js)

Attachments (1)

droptoemptylist.patch (33.1 KB) - added by Auke Bruinsma 8 years ago.
Simple patch to fix this bug

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by Auke Bruinsma

Attachment: droptoemptylist.patch added

Simple patch to fix this bug

comment:1 Changed 8 years ago by Auke Bruinsma

Hello i've created a simple patch it solves 2 issues. The first one is a catched crash when trying to determine the position of the insertion bar and setting the _target value of the drop.

The second is the way the rearange inserts items into the grid. This function trys to determine the cells of an other item in the destination grid to find out which properties should be copied from the dropped item. However is the grid is empty, there is no item to determine the attributes, so it retrieves them from the grid.layout. Also the mapping is empty initialized when the target is grid is empty.

comment:2 Changed 8 years ago by evan

Milestone: tbd1.7

comment:3 Changed 8 years ago by evan

Resolution: fixed
Status: newclosed

(In [25560]) Fixes #12549 patch from Oliver(IBM, CCLA) by making sure rows can be dropped into an empty target grid.

Note: See TracTickets for help on using tickets.