Editor for 'null' and 'undefined' values
See original GitHub issueDescribe the bug JavaScript distinguish two types of data: null, undefined
And when the editor:“textarea” is handling ‘null’ value it converts value to string ‘null’
I do not expect here ‘null’ string for null
value
Tabulator Info
- Which version of Tabulator are you using? 4.1.3
- Post a copy of your construct object if possible so we can see how your table is setup
var tabledata = [
{id:1, country_id: 1, comment: null },
];
var table = new Tabulator("#example-table", {
height:"311px",
data: tabledata,
columns:[
{title:"ID", field:"id", width:40 },
{title:"Comment", field:"comment", editor:"textarea"},
{title:"NA", field:"not_exists", editor:"textarea"},
],
});
To Reproduce Steps to reproduce the behavior:
- Go to JS fiddle
- Click on ‘Comment’ field
- Click on ‘NA’ field
- move focus something else compare result at ‘Comment’ and ‘AN’ cells
Expected behavior When editing ‘null’ it should not be converted to ‘null’ string’
Screenshots
possible workaround If there is null just display input’s placeholder. If placeholder is not initialized, just initialize its as ‘null’ when value is ‘null’ or ‘undefined’ when such field does not exists.
Desktop (please complete the following information):
- OS: Linux Mint 18.3
- Browser FF
- Version v64
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Is there a way to check for both `null` and `undefined`?
1- It will evaluate to true if value is not: null , undefined , NaN , empty string '' , 0 , false...
Read more >Form converts null or undefined values to 0 if a field's ...
However, DxForm forces all undefined or null values to 0 if we use dxNumberBox field editor. It is easy to test this behaviour...
Read more >How to Determine If Variable is Undefined or NULL in JavaScript
Answer: Use the equality operator ( == ). In JavaScript if a variable has been declared, but has not been assigned a value,...
Read more >Null, Undefined and Option | ReScript Language Manual
To create a JS null , use the value Js.Nullable.null . To create a JS undefined , use Js.Nullable.undefined (you can naturally use...
Read more >Types - Null and Undefined - Beginner JavaScript - Wes Bos
Now we will discuss the null type. Null is a value of nothing, whereas undefined is a variable that has not yet had...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks man, now it works great👍🏻
Hey @olifolkerd
I am not 100% sure, but I think I still have the issue with version 4.2.5.
Here is the updated fiddle from @KES777 with my autocomplete code.
The problem is that Tabulator always writes “undefined” into the cell when I jump in with my tab or mouse.