question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Editor for 'null' and 'undefined' values

See original GitHub issue

Describe 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:

  1. Go to JS fiddle
  2. Click on ‘Comment’ field
  3. Click on ‘NA’ field
  4. 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 __ __2

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:closed
  • Created 5 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
webseitzcommented, Apr 30, 2019

Thanks man, now it works great👍🏻

2reactions
webseitzcommented, Apr 10, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found