How to display null values in MDBTable


Topic: How to display null values in MDBTable

karthiksagar9 asked 5 years ago

Expected behavior Display null values from api

Actual behaviorenter image description here

Resources (screenshots, code snippets etc.)


Jakub Chmura staff premium answered 5 years ago

Hi @karthiksagar9,

Can you explain to me what do you mean about this? You mean to show null as a string "null" or put there some kind of placeholder?

Please tell me more about this because I don't know what you want to achieve.

Best, Kuba


karthiksagar9 commented 5 years ago

Hi , Sample response from api { "name":"test", "email":null,

}

In the table i want to display either "null" or "None" in the place of email.


Jakub Chmura staff premium answered 5 years ago

Hi, @karthiksagar9,

I don't know your API structure, but you need to write your own method to replace null values to string "null".

Something like that:

function (key, value) {
    return (value === null) ? "null" : value
}

If there is anything else I could do for you do not hesitate to ask me. I'll be happy to help you.

Best, Kuba


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.25.1
  • Device: MAC
  • Browser: Chrome
  • OS: MAC OS
  • Provided sample code: No
  • Provided link: No