Tabulator: Editor for 'null' and 'undefined' values

Created on 17 Dec 2018  路  14Comments  路  Source: olifolkerd/tabulator

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
Bug

Most helpful comment

Thanks man, now it works great馃憤馃徎

All 14 comments

Hey @KES777

This is a hangover from the old jQuery days of version 3.5 where it used to take care of that for me. i have covered it in most places but that one must have slipped through.

I will fix it in the next patch release

Cheers

Oli :)

also for "autocomplete"
__

Hey @KES777

I have pushed a fix for this to the master branch and will in clude it in this evenings patch release

Cheers

Oli :)

I will retest when major patch release occur

Thank you.

with 4.2.1 version woks fine

but for "autocomplete" still shows undefined
Will add jsfiddle later

@KES777

but for "autocomplete" still shows undefined

Will there be an update to fix this behavior? Would be very helpful for me

this should be question to @olifolkerd

hey @webseitz

Yup, i will include it in this weekends patch release.

Cheers

Oli :)

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.

booo.

I fixed it on the select editor but must have missed something on the autocomplete

I have pushed a fix for this to the master branch and will include it in this weekends patch release

Cheers

Oli :)

Thanks man, now it works great馃憤馃徎

Text Area still shows undefined

Hey @garg10may

If you are having issues relating to a different formatter please create a new issue, this one has been resolved.

Cheers

Oli :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

c3pos-brother picture c3pos-brother  路  3Comments

cemmons picture cemmons  路  3Comments

Honiah picture Honiah  路  3Comments

andreivanea picture andreivanea  路  3Comments

sphynx79 picture sphynx79  路  3Comments