nihad640 / smartgwt

Automatically exported from code.google.com/p/smartgwt
0 stars 0 forks source link

Drag and drop on listgrids with clientsideonly datasources always places the records at the bottom of the listgrid #686

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open test case
2. Drag record from lefthand grid to righthand grid
3. Observe that the record is dropped at the bottom of the righthand grid and 
not at the dropping point.

What is the expected output? What do you see instead?

Expected: Records should be dropped on the location that they are placed

Actual: Records are dropped at the bottom of the listgrid regardless of 
placement

What version of the product are you using? On what operating system?
SmartGWT 3.0p-20120730 with GWT 2.3 and Windows 7

What browser(s) does this happen in?  Are there any browsers where the
issue does not occur?
Only tested in Firefox

Please provide any additional information below.

See thread here http://forums.smartclient.com/showthread.php?t=23673

If I remove the datasource for one of the listgrids, the problem goes away. 
However, I want the datasource because I would like to do things like filtering.

See attached file for example code.

Original issue reported on code.google.com by cog...@gmail.com on 20 Sep 2012 at 9:18

Attachments:

GoogleCodeExporter commented 9 years ago
In general, when working with a ResultSet as your data model (the result of 
calling fetchData() on a ListGrid that has a DataSource), the only way to 
create an ordering that is going to reliably survive filtering operations and 
be compatible with paging is to create a field that stores the order, and keep 
the dataset sorted on that order.

This is shown in the "Persistent Reorderable ListGrid" sample.

However in 3.1d, when specifically have all rows loaded (so no paging issues 
will occur), ResultSet will allow a reorder.  You will still need to save the 
order to a field if you want this to work with paging.

You can also provide data as a RecordList via setData() and reordering is then 
allowed.

Original comment by smartgwt...@gmail.com on 21 Sep 2012 at 9:39

GoogleCodeExporter commented 9 years ago
The issue isn't reordering.  Reordering works fine when records are dragged 
within the listgrid.  When I try to drop a record from a separate listgrid, the 
location of the drop is not obeyed.

Adding a sorting field and maintaining order there will not fix the problem. 
When a record is transferred from one listgrid to the next, I won't know where 
it was dropped. The drop index information (as far as I can tell) is not given 
to the drop handler.

Original comment by cog...@gmail.com on 21 Sep 2012 at 10:25

GoogleCodeExporter commented 9 years ago
The drop index and drop position are available - getDropPosition() and 
getEventRow().

Original comment by smartgwt...@gmail.com on 21 Sep 2012 at 10:34

GoogleCodeExporter commented 9 years ago
Ahh, that will be really helpful then.  Thanks!

Original comment by cog...@gmail.com on 21 Sep 2012 at 10:42