Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Row duplicates last row when table display is sorted by column #1072

Closed
amclin opened this issue Sep 30, 2013 · 8 comments
Closed

Remove Row duplicates last row when table display is sorted by column #1072

amclin opened this issue Sep 30, 2013 · 8 comments
Labels
Milestone

Comments

@amclin
Copy link

amclin commented Sep 30, 2013

Steps to replicate:

  1. Sort a table so that the row that originally displayed first is now displaying last
  2. Remove the first displayed row using the contextual menu

Expected Result:

First displayed row should be removed. Table should be shorter by one row.

Actual Result:

Selected row is removed, but the last displayed row in the table (the original first row) is visually duplicated. It is not duplicated in the data, only the display.

I can replicate this consistently with a copy of the sorting example. Reduce the generated rows to less than 10 to make the issue more visible:
http://jsfiddle.net/api/post/library/pure/#&togetherjs=Hlh75kFAVf

@amclin
Copy link
Author

amclin commented Sep 30, 2013

Adding a call to sort() in afterRemoveRow will cause the troublesome row to be emptied, however, that leaves a blank row in the table.

@psmolenski
Copy link
Contributor

The jsFiddle link you provided does not work

@amclin
Copy link
Author

amclin commented Oct 1, 2013

http://jsfiddle.net/xpgkZ/

This is just the sortable example with the generated row count reduced to 5.

  1. Sort by column A, so that A00 shows last.
  2. Select the first cell in column A (content should be A40)
  3. Right-click, and remove row using context menu

Result: Cell A00 shows twice at the bottom of the list

@cuongtran-6618
Copy link

Hello, I still can produce this error, I use
example in demo page: http://handsontable.com/demo/contextmenu.html

  1. I added few more row with same format of data, then I did sorting by column C, removed one row.
  2. Blank row or duplicate row would appear.

Do you have any idea how it is possible to get rid of this bug?

@psmolenski
Copy link
Contributor

Could you provide some more details on how to reproduce the error?

  1. How many rows did you add?
  2. Where did you add those rows (above/below which rows) ?
  3. Exactly what data did you put in the cell of newly created rows?
  4. Which rows did you tried do remove?

@cuongtran-6618
Copy link

Yes, of course, my pleasure. Here how I did it.

  1. I added 3 more array element in getData function, so it looks like this

function getData() {
return [
["", "Kia", "Nissan", "Toyota", "Honda"],
["2008", 10, 11, 12, 13],
["2009", 20, 11, 14, 13],
["2010", 30, 15, 12, 13],
["2011", 10, 11, 12, 13],
["2012", 20, 11, 14, 13],
["2013", 30, 15, 12, 13]
];
}

  1. then I set columnSorting: true. That's all I done.
  2. I did sorting by column D (Toyota) by DESC. then I removed row "2010" (second row). Error was occurred, in my case: the duplicate row (row 4 and 6 which were present "2013" but these should be 2011 and 2013).

@warpech
Copy link
Member

warpech commented Jan 12, 2014

This is fixed now in 0.10.1. Could you please try again?

@warpech warpech closed this as completed Jan 12, 2014
@cuongtran-6618
Copy link

cool, yes it is. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants