Formatting boolean fields

Formatting boolean fields

skyetechskyetech Posts: 10Questions: 0Answers: 0
edited February 2012 in General
I'm retrieving records from a database using json. The boolean fields come back as True/False. I'd like to display Yes/No instead. How would I do that in Datatables? Thanks.

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Three options:

    1. Use your server-side script to modify the data before it is sent to the client.

    2. Use fnRender to render the string as you wish.

    3. Use mDataProp as a function (must the same as fnRender, but you get more control over the different data types - sorting, filtering, display etc).

    Option 2 is probably the easier to implement as it will just take a couple of lines of code.

    Allan
  • skyetechskyetech Posts: 10Questions: 0Answers: 0
    fnRender worked. Thanks.
This discussion has been closed.