$NaN in Integer Column for Null Values

$NaN in Integer Column for Null Values

DanOshDanOsh Posts: 37Questions: 11Answers: 1

Hi All, first, just found this site and the Editor today and it is something I've been trying to find. It is a great way to get into personalizing and customizing data on the web.

I have a test page I mirrored the simple example at www.skywateryachts.com/datatables_editor/examples/simple/boats.html.

I'm getting in the Listing Price column cells with $NaN where they are Null in the MySql table. Any idea how I can make these tables empty?

Thank you.

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin
    Answer ✓

    Hi,

    I've just committed a little change to DataTables that will allow this to work correctly. Could update your DataTables Javascript include to pull in the nightly version. Also, you will need to use columns.defaultContent to specify what you want to appear in the cells where there null data - for example:

    {
      data: "Listing_Price",
      render: $.fn.dataTable.render.number( ',', '.', 0, '$' ),
      defaultContent: "Price on request"
    },
    

    The change I've made in DataTables is to allow the renderer to pass the null value back - which means that the defaultContent can be used.

    Regards,
    Allan

  • DanOshDanOsh Posts: 37Questions: 11Answers: 1

    Hi Allan,

    Thank you for the prompt reply. I did apply the nightly downloads, but the area I'm working on is in the 'Editor' folder's .js and .css files and it appears those are not the same. Which brings me to ask, is there a right or wrong of uploading the editor in a separate folder or should it be uploaded under the 'datatables' folder? Initial glance tells me it doesn't matter.

    And how do the nightly updates work for the 'datatables' and the 'datatables editor'? I would think on a change to one, there would be a change to the other.

    I'm working on table builds for both public/private tables and an admin area.

    http://www.skywateryachts.com/datatables_editor/examples/simple/boats.html

    Thanks,

    Dan

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin
    Answer ✓

    Hi Dan,

    In the page's source change:

    //cdn.datatables.net/1.10.5/js/jquery.dataTables.min.js

    to:

    //datatables.net/download/build/nightly/jquery.dataTables.min.js?_=8ad39b7e0f90575b20da99d7495efa87

    To use the nightly version of DataTables.

    I would think on a change to one, there would be a change to the other.

    Not in this case :-). Sometimes Editor will require a specific version of DataTables, but I try to enforce such as change as little as possible.

    Allan

  • DanOshDanOsh Posts: 37Questions: 11Answers: 1

    Ok. Well done. Did the job!

    Love this application. Best I've seen around. This is more hands on to learn working with data.

    Fast response and the forum is exhaustive and responsive.

    All together it convinces me to purchase the editor!

    I can't wait to get deep into all the code and extensions.

    Thanks for a great product!

    Dan

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin
    Answer ✓

    Good to hear that did the job for you, and thank you for your kind words :-)

    Allan

  • DanOshDanOsh Posts: 37Questions: 11Answers: 1

    You're very welcome. It was deserved.

This discussion has been closed.