• Resolved grokwhy

    (@grokwhy)


    Hello,

    I have boolean data – tinyint(1) that is displayed in the table builder as 0 or -1. I’d like this to be displayed as Yes if -1, or Yes or No.

    I couldn’t find a reference to this through search, but it must be a common problem. I’m using the paid version.

    BTW, Data Access is great. I can imagine the possibilities.

    Thanks,
    Russ

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Kim L

    (@kimmyx)

    Hi Russ,

    We’re happy to know you’re enjoying WP Data Access. ??

    To display Yes or No depending on the data value, you need to add custom renderers to your table via Advanced settings | WP Data Access.

    A similar discussion from DataTables can be found here: Replace 0 with No and 1 with Yes in Display — DataTables forums

    Hope that helps. Let us know if you have more questions.

    Thread Starter grokwhy

    (@grokwhy)

    @kimmyx ,

    Sorry for being so dense, but could you give me a working example? I followed the link, but I can’t get that sample to work. Damn you! Red X!

    So say I have a column name isHappy and if it’s 0 that’s NO, 1 is YES. I think if I had a working example of, if it’s column name X then do this code, like the render function in the example code, I could modify from there.

    Thanks!
    GrokWhy

    Plugin Contributor Kim L

    (@kimmyx)

    Hi @grokwhy,

    Apologies for the delay in response. I realized you just wish to modify the display value on the table and not in the database.

    The function you want requires JavaScript and before using them in Advanced Options, the function is wrapped between double-quotes to maintain JSON format.

    I’ve managed to modify the function for your purpose. Please see my test here: https://share.getcloudapp.com/geuP9yO0

    Could you send us a message via Contact | WP Data Access as this is custom code exclusive for premium users.

    We’ll wait for your email!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Table Boolean Display’ is closed to new replies.