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

Error adding row when column sorting is in effect #858

Closed
provegard opened this issue Jul 3, 2013 · 4 comments
Closed

Error adding row when column sorting is in effect #858

provegard opened this issue Jul 3, 2013 · 4 comments
Labels

Comments

@provegard
Copy link

After sorting on a column and I add a new row to the data and then call render, I get the following error in the console:

Uncaught TypeError: Cannot read property '0' of undefined jquery.handsontable.full.js:4905
HandsontableColumnSorting.translateRow jquery.handsontable.full.js:4905
Handsontable.PluginHookClass.PluginHookClass.run jquery.handsontable.full.js:4641
instance.PluginHooks.run jquery.handsontable.full.js:2549
datamap.get jquery.handsontable.full.js:337
getDataAtCell jquery.handsontable.full.js:2106
HandsontableAutoColumnSize.determineColumnWidth jquery.handsontable.full.js:4758
HandsontableAutoColumnSize.determineColumnsWidth jquery.handsontable.full.js:4819
Handsontable.PluginHookClass.PluginHookClass.run jquery.handsontable.full.js:4641
instance.PluginHooks.run jquery.handsontable.full.js:2549
Handsontable.TableView.beforeRender jquery.handsontable.full.js:3008
walkontableConfig.beforeDraw jquery.handsontable.full.js:2954
WalkontableSettings._getSetting jquery.handsontable.full.js:8186
WalkontableSettings.getSetting jquery.handsontable.full.js:8180
Walkontable.getSetting jquery.handsontable.full.js:6759
Walkontable.draw jquery.handsontable.full.js:6719
Handsontable.TableView.render jquery.handsontable.full.js:3015
selection.selection.refreshBorders jquery.handsontable.full.js:869
render jquery.handsontable.full.js:1814
$.fn.handsontable jquery.handsontable.full.js:2673
(anonymous function) fiddle.jshell.net/:63
jQuery.event.dispatch jquery-1.9.1.js:3074
elemData.handle jquery-1.9.1.js:2750

Try the following fiddle: http://jsfiddle.net/provegard/egaFm/4/

Before doing anything, click on the button to add a new row. It works just fine. Then sort on a column, e.g. C. Then click on the button again. The error above appears in the console, and no row is added.

Because of #857, this is pretty much a show-stopper for using column sorting. Unless there is another way of sorting columns while still being able to add new rows? So it would be nice if this could be given above normal priority. :-)

@ghost ghost assigned psmolenski Aug 9, 2013
@psmolenski
Copy link
Contributor

Until we figure out how to fix this problem, I suggest invoking sort() method after adding/removing rows. sort() will rebuild sortIndex and invoke render() afterwards. I've prepared a jsFiddle with workaround: http://jsfiddle.net/egaFm/5/

psmolenski added a commit that referenced this issue Sep 4, 2013
…veChanges plugin if it's not disabled explicitly.
psmolenski referenced this issue Sep 5, 2013
Conflicts:
	test/jasmine/spec/plugins/columnSortingSpec.js
@psmolenski
Copy link
Contributor

Fixed in version 0.9.17. Please, upgrade and confirm.

@antsingle
Copy link

When I copy the password to Excel,it is visible...

@psmolenski
Copy link
Contributor

@antsingle, how is it related to the problem described in this issue?

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

Successfully merging a pull request may close this issue.

3 participants