DataTables 1.7 available

DataTables 1.7 available

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

It is with real pleasure that I can announce the availability of DataTables 1.7.0! For those wanted to get on with it immediately:

- Download: http://datatables.net/releases/dataTables-1.7.0.zip
- New features summary: http://datatables.net/new/1.7
- Upgrade notes: http://datatables.net/upgrade/1.7

Please note, if you are using regular expression filtering in DataTables, there has been a change to this interface in 1.7.0. Likewise the internal data cache 'aoData' has changed slightly to no longer allow null values. Please read the upgrade notes if you use either of these features!

In a bit more detail: DataTables 1.7 has been planned more or less since the moment 1.6 was released, and as been under active development for the last three months. It has three primary new features:

- Object retrieval - you can use the DataTables initialisation function to retrieve the object that was originally created for the DataTable (so you don't need to keep global variables any more).
- Column definitions - the aoColumns array was very rigid before, requiring exactly the right number of entries in it (often with many 'null's to make up the numbers). While this is still available, aoColumnDefs is now available to allow targeting of specific columns.
- Scrolling - A DataTable can now be placed into a scrolling viewport.

In addition to these new features, there are a number of smaller ones which aim to make your life as a developer much easier, bug fixes and code tidy up. Indeed it is worth noting that DataTables 1.7.0 when minified, is actually smaller that 1.6.x due to the use of Google's excellent Closure compiler!

I would like to extend a huge thank you to all of those who have been beta testing this new release of DataTables, and reporting bugs back to me. Thanks also to everyone for suggesting enhancements which can be made to DataTables!

Finally, if you are finding DataTables useful - please consider making a donation towards it's continued development: http://datatables.net/donate :-)

Enjoy DataTables 1.7!

Regards,
Allan

Replies

  • jnm99jnm99 Posts: 10Questions: 0Answers: 0
    congratulations!

    One small thing I noticed is that comments in media/css/demo_table_jui.css say that most of it is the same as demo_table.css but a diff shows that the parts that are supposed to be common are out of sync.
  • allanallan Posts: 63,678Questions: 1Answers: 10,498 Site admin
    Hi jnm99,

    Good spotting! I've put an updated version of the jui.css file here: http://datatables.net/release-datatables/media/css/demo_table_jui.css .

    Regards,
    Allan
  • kkudikkudi Posts: 77Questions: 0Answers: 0
    Hi Allan,

    Quick question, column alignment works fine, but when it comes to the end of the last column there's perhaps space of one centimetre of scrolling ( horizontally) and taking it further to the right, misaligns the columns..

    any idea why?

    links :

    http://img529.imageshack.us/img529/5290/alignmentm.jpg

    http://i25.tinypic.com/t7la14.jpg
  • allanallan Posts: 63,678Questions: 1Answers: 10,498 Site admin
    Can you link to an example which is doing this please? Also which browser are you using - as that will most likely make a difference.

    Allan
  • kkudikkudi Posts: 77Questions: 0Answers: 0
    Allan,

    That was Safari 5, but the same behaviour is replicated on Firefox and IE7.

    I wish I was able to give you a link but I can't. It's all firewalled and running locally on my machine.
  • allanallan Posts: 63,678Questions: 1Answers: 10,498 Site admin
    Can you tell me how to set up one of my examples to reproduce this then please? I can't seem to reproduce it. I have seen this effect with some of the betas (the reason as that the wrapper around the header wasn't being expanded as it should have been), but that was fixed during the beta series - so this might be related, or something else...

    Allan
  • kkudikkudi Posts: 77Questions: 0Answers: 0
    edited August 2010
    [code]
    $('#trading_positions_table').dataTable({
    "sDom": '<"top"i>rt<"pos_links"><"bottom"p><"clear">',
    "aoColumns":[
    {"sType": "string"},
    {"sType": "numeric-comma"},
    {"sType": "numeric-comma"},
    {"sType": "numeric-comma"},
    {"sType": "numeric-comma"},
    {"sType": "numeric-comma"},
    {"sType": "numeric-comma"},
    {"sType": "numeric-comma"},
    {"sType": "numeric-comma"},
    {"sType": "string"},
    {"sType": "numeric-comma"},
    {"sType": "string"},
    {"sType": "numeric-comma"}
    ],
    "sPaginationType": "full_numbers",
    "bPaginate": true,
    "aLengthMenu": [[10, 25, 50,100, -1], [10, 25, 50,100, "All"]],
    "aaSorting":[],
    "bFilter": false,
    "bInfo":true,
    "bAutoWidth": true,
    "bSortClasses": false,
    "iDisplayLength": 250,
    "sScrollY":"275px",
    "sScrollX":"100%",
    "bProcessing":true,
    "fnRowCallback": function( nRow, aData, iDisplayIndex ) {
    //decorateTradingPosRow(nRow);
    return nRow;
    },
    "oLanguage":{
    "sZeroRecords": "No positions",
    "sEmptyTable": "No positions"
    }

    });

    [/code]

    html for table:
    [code]



    <%
    int i = 0;
    for (String col : tradingPositionColumns) {
    if (i==0 || i==9 || i == 11 || i == 1) {
    %> <%=col%>
    <%
    } else {
    %>
    <%=col%>
    <%
    }
    %>
    <% i++; }

    %>





    [/code]

    The class='right' in some of the columns does nothing.

    My javascript loops through a result set, and uses fnAddData to add each row, does an fnDraw at the very end

    and then continuously updates every 5 seconds or so using fnUpdate ( each row)

    the only change I made to ur code was to add an extra parameter in fnAddData so that the buildSearchArray is not called every time I add a row as this was making it extremely slow.
  • kkudikkudi Posts: 77Questions: 0Answers: 0
    Also, for some reason, the following returns -183px for some reason and IE says that it's an invalid argument for nScrollHeadInner.style.width

    Firefox prints -183 but somehow fixes it and returns the correct value.

    Any idea why?


    [code]

    nScrollHeadInner.style.width = _fnStringToCss( $(o.nTable).outerWidth()+o.oScroll.iBarWidth );

    [/code]
  • kkudikkudi Posts: 77Questions: 0Answers: 0
    It's interesting to say that if I comment out the following line, the mis-alignment is gone and the error in IE is also gone.

    [code]

    nScrollHeadInner.style.width = _fnStringToCss( $(o.nTable).outerWidth()+o.oScroll.iBarWidth );

    [/code]
  • gutzoftergutzofter Posts: 58Questions: 0Answers: 0
    @Allan - could you give us a guesstimate of the number of programming hours you spent putting together this release?
  • wcmaneswcmanes Posts: 19Questions: 1Answers: 0
    Hi Allan,

    Just wanted to say that DataTables 1.7 is a great accomplishment. The scrolling features are a significant improvement in the user interface. It's remarkable what you have done with this product. You're my hero :)
  • jsmreesejsmreese Posts: 6Questions: 0Answers: 0
    Thanks for including the exact feature I was looking for (aoColumnDefs) right when I needed it!

    You may want to add a note note on the Columns page where you document aoColumnDefs that it is a new feature with dataTables 1.7. I'd been using 1.6 and didn't know about the update, so I was a little confused when I tried to use the parameter and it did nothing!
  • allanallan Posts: 63,678Questions: 1Answers: 10,498 Site admin
    edited August 2010
    @kkudi - any chance you can provide a link showing the -183px issue? I'd really like to get to the bottom of that. It is exactly the right size for the scroll bar width to have been calculated if you add 200px!

    @gutzofter - good question. It's not something I've been keeping a track of, but at a rough guess I'd say around 80-100 hours for the development time - plus whatever on the forums.

    @wcmanes - thanks! :-)

    @jsmreese - Good point! The documentaiton on the site always refers to the latest sable version - but I'd agree that this is worth mentioned here. So I've added a note in for it.

    Regards,
    Allan
  • ikvarmaikvarma Posts: 8Questions: 0Answers: 0
    I noticed the following change when i moved from 1.6 to 1.7
    [code]
    "aoColumns": [
    {
    "sWidth": "10%",
    "fnRender": function (oObj) {
    return function_name1(oObj.aData[0]);
    }
    },
    {
    "fnRender": function (oObj) {
    return function_name2(oObj.aData[1]);
    }
    },
    {
    "fnRender": function (oObj) {
    return function_name3(oObj.aData[0],oObj.aData[2]);
    }
    }]
    [/code]

    for the above code when i am using 1.6
    In the third column oObj.aData[0] used to be same value as in 1st column

    when i moved to 1.7 ,
    oObj.aData[0] is now changed to the return value of function_name1(oObj.aData[0]);

    I just want to know whether it is a change or an issue in my code ?
  • allanallan Posts: 63,678Questions: 1Answers: 10,498 Site admin
    Hi ikvarma,

    I'm slightly surprised that this has changed - and indeed, I just tried it with 1.6.2 and it seems to give the same behaviour as 1.7 - which as you point out is to use the rendered data after it has been rendered.

    The only way around this really at the moment is to use bUseRendered for the column - but that will impact on filtering and sorting. It might be that DataTables needs to store the original data as well as the rendered one, so it is available. Something to consider for a future release. Until then, one way around this would be to have a variable which you can assign aData[0] to. For example:

    [code]

    "aoColumns": [
    {
    "sWidth": "10%",
    "fnRender": function (oObj) {
    col0 = oObj.aData[0];
    return function_name1(oObj.aData[0]);
    }
    },
    {
    "fnRender": function (oObj) {
    return function_name2(oObj.aData[1]);
    }
    },
    {
    "fnRender": function (oObj) {
    return function_name3(col0,oObj.aData[2]);
    }
    }]

    [/code]
    Since the functions will execute sequentially this should work okay.

    Allan
This discussion has been closed.