Handling nulls in DataTable

Hi,

I’m new to webix. I have a server side app that returns JSON where some fields can be null, e.g. {field: null, … }. I can’t change the server side app currently. When I bind this data to a DataTable cells display the value null. What is the best solution to display an empty cell (I want to avoid a custom template for each column, if possibile). I also noted that exporting this data to Excel format fails with errors.

Thank you in advance for your help.

Hi,

you can use template property in column configuration to customize html for cells:

{ 
    id: "field", 
    template: function(obj){
        return obj.field||""
    }, 
    ...
}

Please be sure that you are using Webix 2.2
Older version has known issues with null values, the latest one must process them correctly

http://webix.com/snippet/464a849d