DataTables 1.7.1 released

DataTables 1.7.1 released

allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
edited August 2010 in Announcements
Hello all,

The first bug fix version of the 1.7 DataTables series is now available, and addresses a number of issues which have been brought to light since the 1.7.0 release (the full list of bug fixes can be found in the release notes).

In addition to the bug fixes, there are two new features in this release, both of them callback functions. The new fnCookieCallback function allows customisation of the state saving cookie, while fnInfoCallback allows detailed manipulation of the information element's text string.

- Download: http://datatables.net/releases/DataTables-1.7.1.zip
- Release notes: http://datatables.net/download

If you are using DataTables and finding it useful - please consider making a donation to help maintain and support DataTables in future: http://datatables.net/donate

Regards,
Allan

Replies

  • UPEngineerUPEngineer Posts: 93Questions: 0Answers: 1
    Allan,

    Thanks for all the hard work you do on Datatables.

    One quick note, I have always tried reading the release notes for your releases and have never been able to because I was using IE. Today, I noticed a js error on the releases page and sure enough there is release notes as I found in Firefox! LOL.

    The code that seems to screw with IE is:
    [code]
    jQuery.fn.dataTableExt.oSort['title-numeric-asc'] = function(a,b) {
    var x = a.match(/title="(.*?)"/)[1];
    var y = b.match(/title="(.*?)"/)[1];
    x = parseFloat( x );
    y = parseFloat( y );
    return ((x < y) ? -1 : ((x > y) ? 1 : 0));
    };
    [/code]

    Says this as error:

    Message: 'match(...).1' is null or not an object
    Line: 39
    Char: 5
    Code: 0
    URI: http://datatables.net/download

    Just thought I would let you know....

    Thanks again.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi UPEngineer,

    Great to know that someone other than myself does use the release notes :-) Thank you for picking up this error - I was using an old version of the hidden title numeric sorting plug-in, which as you saw doesn't really work in IE... The updated version does :-)

    Regards,
    Allan
  • rewenrewen Posts: 74Questions: 2Answers: 0
    Hi Allan,

    I noticed that after my switch from 1.7 to 1.7.1, if I have bVisible: false; on a column (the last column in my particular case) the table will no longer set the width properly regardless of whether the bAutoWidth setting. In my case the table gets a style width: 570px set to it and no matter what i do I can't seem to make it go back to 100% unless I unhide that last column.

    I am not sure if this would be a bug or a misunderstanding on my part
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi rewen,

    Could you possibly post a link to an example showing this, or your initialisation code please? There was a chage which might well effect this, although it took the behaviour back to that of 1.6.x I believe. Either way, this sounds like it might need a little more investigation.

    Regards,
    Allan
  • rewenrewen Posts: 74Questions: 2Answers: 0
    Sorry I don't have an example up, I immediately switched back to 1.7 when it happened.

    I might try to get you an example if I have time.

    My init code is:

    [code]
    tax_code_table = $('#tax_code_list').dataTable({
    "bServerSide": true,
    "bProcessing": true,
    "sAjaxSource": "libs/ajax_tax_code_list.php",
    "aaSorting": [[1,"asc"], [0,"asc"]],
    "bJQueryUI": true,
    "sPaginationType": "full_numbers",
    "bPaginate": true,
    "iDisplayLength": 25,
    "aLengthMenu": [
    [10, 25, 50, -1],
    [10, 25, 50, "All"]
    ],
    "aoColumns": [
    { "bVisible": false, "bSearchable": false }, // id
    null, // name
    null, // code
    null, // tax_percent
    null, // rebate_percent
    null, // rebate_purchase_cap
    { "sWidth": "20px", "bSortable": false, "bSearchable": false }, // edit
    { "sWidth": "20px", "bSortable": false, "bSearchable": false } // remove
    ],
    "bAutoWidth": false
    });
    [/code]
  • rewenrewen Posts: 74Questions: 2Answers: 0
    I should also mention that it didn't matter what I did with the sWidth's and bAutoWidth. If I took them out it still wouldn't go 100% wide (and I tried CSS to do that as well)
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi rewen,

    Thanks for the code. I'm afraid I'm not sure I fully understand what the issue is (sorry). So if you have a hidden column, the table doesn't get width:100%? Do you have a css definition for the table's width?

    Allan
  • rewenrewen Posts: 74Questions: 2Answers: 0
    edited August 2010
    Correct - if I have CSS staying to make the table 100% wide, this works in every other version of datatables I have used (incl 1.6.x), under all circumstances.

    In 1.7.1 it works until I set a column to "bVisible": false, at which point my tables were getting crammed in size - actually squishing all of the content. Using Chrome Inspector I would see my table getting something like style="width: 570px". In fact even if I manually set column widths in my init code, it would ignore some of them (seemed random).
  • rewenrewen Posts: 74Questions: 2Answers: 0
    Now that I tried to recreate the issue I found that it's the CSS file causing the problem. It only happens if I use the unmodified demo_table_jui.css file from 1.7.1 (which has no width: 100% setting in the wrapper). If I add width: 100% to the wrapper then things are fine.

    Also, if I use my own css file called (a modified version of the 1.7 demo_table_jui.css) then it works fine with the 1.7.1 js.

    I thought I was experiencing the issue with my custom file but I must have gotten things mixed up and was actually using the stock file the entire time. Oops!

    I just copied my few customizations to the stock 1.7.1 file and it works great as well.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Ah good stuff! Although I looked at the JUI css file with 1.7.1 and it does indeed have a width:100% for table.display.

    Allan
  • rewenrewen Posts: 74Questions: 2Answers: 0
    edited August 2010
    While I'm here can I add a suggestion?

    It would be nice if there was a true 'barebones' css file (jui and non-jui) that didn't include anything specific to the examples. I am a minimalist but I am never sure which styles can be removed from the demo files every time there is an update and I move my customizations from the previous css to the new one. I move my customizations on every update since I am not sure if there were any critical css changes or not, so better safe than sorry.

    Another suggestion is to move the css_right class into the demo/barebones css files. I had a hell of a time figuring out that I was missing a single class when first setting it up, and then again on another website. I just couldn't for the life of me figure out why the sort icons were messed up and I knew "float: right" would fix it but I couldn't be sure that it was the proper thing to do, so I nearly gave up until I found the .css_right class within another file.
  • rewenrewen Posts: 74Questions: 2Answers: 0
    the table.display width didn't seem to affect anything for me.. I added this for my tables:

    [code]
    .dataTables_wrapper table {
    border: 1px solid #ccc;
    width: 100%;
    }
    [/code]
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Looks good. Funny since it seems to work okay for me - but it might just be a slightly different environment thing. I'll keep an eye out for this!

    Thanks,
    Allan
  • rewenrewen Posts: 74Questions: 2Answers: 0
    Maybe I missed it in the examples but I wasn't adding class="display" to my tables. I was assuming that the javascript did that automatically at some point I guess..

    If I add class="display" then it definitely does go 100% and it looks a little nicer than my formatting. :)
This discussion has been closed.