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
#bad value# in an empty cell #1539
Comments
I'm seeing the same issue on 0.11.4: See a running example here: http://jsfiddle.net/2xv3ojqa/ When minSpareRows is set and the table is empty then the checkbox column displays "#bad value#" for the initial row and all new rows. But that isn't the case when there is at least one existing row. |
Thanks for reporting! We'll try to fix this within milestone 0.11.5. Stay tuned! |
@zorab47 try to add dataSchema: {car: null, year: null, comesInBlack: null} into your settings. |
Also happens when pressing delete on the checkbox cell.. |
Is this fixed? I don't see it in any milestones anymore? |
This issue still exists, |
Go to http://handsontable.com/demo/checkbox.html. |
I am also experiencing the same error. When I my cell has a value inside and I change it's type, it displays a #bad value#. If the cell value is null, then it's fine. |
"#Bad value" also happens when you have an empty data set, ie. you are starting out with an empty table, that has only the columns and column headers predefined. This is in current master. |
I also have the issue when I uncheck a checkbox and I use checkedTemplate and uncheckedTemplate. You can try this jsfiddle : |
Thanks for sharing @ichiriac I'm reopening this issue. |
I have the same problem as ichiriac. If I use a checkedTemplate of 1 and an uncheckedTemplate of 0, I get #bad-value# when unchecking the box. Any workaround for this? I am using 0.26.0. |
It's problem with checkedTemplate/uncheckedTemplate. |
I try to set a checkbox by doing the following. Hot. GetCellMeta(0,0).type= "checkbox";. And i get #bad-value# |
hi @mota57 I've tested this example here: http://jsfiddle.net/kt6racbp/ seems it works as expected |
@AMBudnik if you paste text or drag a cell to the cell with the checkbox you will get #bad-value# |
I don't think it's the first time that this bug is reported no ? |
@AMBudnik ok but what if you want to put a checkbox on the first cell of the first column. ? It said #bad-value#. So how to handle that ? test it yourself.!! |
Hey I think I fix what I was saying. So your code should look like this and the default value would be "false". Test it!!!!. ...but now I have another problem after I save the sheet and reload the data all those columns that had checkbox now contain only values like true or false....instead of the proper checkbox. hot1.getCellMeta(lastCoordinates.startRow, lastCoordinates.startColum).type ="checkbox"; |
Thanks for sharing additional details @mota57 Unfortunately it works like that when there's a bug all actions taken after produce even more bugs. |
Thanks to our trusted user Chow we have managed to take one step towards understanding this bug. |
@AMBudnik I am sorry but if you copy paste text in the checkbox cell, the type is still changing with #bad-value#. Although I am not sure if your change aimed that issue in particular.. |
You're right @marc-antoinepelletier |
@mota57 Let me make sure if I understand what you're trying to achieve. If you're trying to make the cell at (0,0) coordinates a checkbox, you'll need to either:
Take a look at this example: http://jsfiddle.net/js_ziggle/2enh673x/
Otherwise the checkbox renderer wouldn't know what to render. Similarly to @marc-antoinepelletier example:
How would the checkbox renderer know if "Mercedes A 160" translates to "checked" or "unchecked"? I wouldn't know either :) |
Oh, and the bug @AMBudnik found is probably caused by |
@jansiegel I assume the checkbox renderer would check the value passed the cell, and if it's not a default boolean or any other default checkbox value you assigned in the setting, it would check the value or do nothing no ? I had to make a custom checkbox renderer to translate this behaviour, I figure that should be handle by default in Handsontable no ? |
@marc-antoinepelletier I'm not sure what you mean by
What the renderer does is checking if the cell value is the same as the one defined in the templates, and if there are none, check if the value is a boolean. If nothing passes that verification it displays |
I meant it would check (true value) or leave the cell as it is without updating it. From what you are saying, the most logic way would be that nothing should happen to the checkbox cell at the end instead of displaying #bad-value# if the value doesn't correspond no ? |
@marc-antoinepelletier Ok, now I get it. Thanks for clarifying! I think it's a good idea for a new feature - setting the |
@jansiegel Awesome, Thanks ! :) |
Hi, there's a problem with checkbox columns. When an empty row is added to a table, it contains #bad value# in checkbox cells and you cannot change this value to anything else - the cell is read only, stuck with #bad value# in it. I'd like to specify some default value for a new row, but there's no way to do so.
Version: 0.10.5
The text was updated successfully, but these errors were encountered: