DataTables 1.7 beta 6 released

DataTables 1.7 beta 6 released

allanallan Posts: 63,488Questions: 1Answers: 10,468 Site admin
edited July 2010 in Announcements
Hello all,

I'm really pleased to be able to release DataTables 1.7 beta 6. This release sees a number of bugs which have come to light in previous releasing being addressed, with an eye now on the 1.7.0 stable release.

Please continue beta testing, and letting me know of any issue you encounter. Baring any major upsets, the next release will be 1.7.0 :-)

As per usual:
Full release notes: http://datatables.net/download .
Download 1.7 beta 6 directly: http://datatables.net/releases/dataTables-1.7.beta.6.zip
Please donate to help keep DataTables supported in under active development: http://datatables.net/donate :-)

Regards,
Allan

Replies

  • sd_zuosd_zuo Posts: 78Questions: 1Answers: 0
    edited July 2010
    I hope to save your and my bandwidth.
    Is it possible to release a neat version with the minimized js file only?
  • allanallan Posts: 63,488Questions: 1Answers: 10,468 Site admin
    Hi sd_zuo,

    If you download the above zip file, then unzip it and look in the media/js directory, you will see a minimised files, as well as a gzipped version. The minimised file is compiled using Google Closure.

    Regards,
    Allan
  • sd_zuosd_zuo Posts: 78Questions: 1Answers: 0
    Yes, I know that.
    I meant that you provide that file only, so I don't need to download other resource files again but just grab the minimized js.
  • allanallan Posts: 63,488Questions: 1Answers: 10,468 Site admin
    Oh I see what you mean. I often modify file other than just the core JS file (examples etc) in each release, so it's no bad thing having the latest package, however, it does seem to be a good idea to have a 'feed' with the latest stable and beta copies of DataTables available. I'll look into a good way of doing that.

    Regards,
    Allan
  • kkudikkudi Posts: 77Questions: 0Answers: 0
    [code]
    nScrollHeadInner.style.width = ($(o.nTable).outerWidth()+o.iScrollWidth)+"px";
    [/code]

    I get an error on this line with invalid argument on IE7. any idea what's causing it? Have just upgraded to 1.7 beta 6.
  • allanallan Posts: 63,488Questions: 1Answers: 10,468 Site admin
    Very odd! I wonder why that line would fail and not the one before it:

    [code]
    nScrollHeadTable.style.width = $(o.nTable).outerWidth()+"px";
    nScrollHeadInner.style.width = ($(o.nTable).outerWidth()+o.iScrollWidth)+"px";
    [/code]
    o.iScrollWidth is the key difference, but that should not be null (or NaN)! Are you able to put up an example of this occurring? That would be very useful - or indicate how I can modify one of my examples to cause it.

    Regards,
    Allan
  • kkudikkudi Posts: 77Questions: 0Answers: 0
    I'm not sure how to give you an example, basically the table is under jQuery UI tabs....and table is loaded via ajax, but it's synchronous so i dont udnerstand what is causing the error. I have other tables within the tabs and it's the only one that has the issue.
  • allanallan Posts: 63,488Questions: 1Answers: 10,468 Site admin
    Are you able to send me a link ( http://datatables.net/contact ) if it's a web "visible" site, or is it behind a firewall? I can't really explain why it would fault at that line and not somewhere else if that one is going to fail...

    Allan
  • kkudikkudi Posts: 77Questions: 0Answers: 0
    I ll try and do that tonight....
  • kkudikkudi Posts: 77Questions: 0Answers: 0
    I k now this is silly but what is the effect of that line?

    [code]
    nScrollHeadInner.style.width = ($(o.nTable).outerWidth()+o.iScrollWidth)+"px";

    [/code]

    If i comment it out, everything works as expected.
  • allanallan Posts: 63,488Questions: 1Answers: 10,468 Site admin
    The table which shows the header has a div wrapped around it (nScrollHeadInner) - it needs to have a width of the table + the scrollbar width, otherwise x-scrolling will cause the table to go out of alignment when you scroll all the way to the right. This addresses exactly that. So it is needed, but I can't see why it would error out - but would like to get it sorted out!

    Regards,
    Allan
  • iuliandumiuliandum Posts: 70Questions: 0Answers: 0
    Allan,
    you said that 1.7.0 version will be released this weekend. Till this version, I will sugest you improvment of current release. I ask you sorry for my speak english but I hope you understand me.

    I sugest you to make horizontal scrolling comport like vertical scrolling.

    When a row needs a greater height, it isn't taken from adjacent rows but grows sScrollYInner.
    Just suggest you do same with horizontal scrolling. When a column requires a width greater than that fixed by sWith, width of columns adjacent to remain unchanged, but sScrollXInner be automatically increased value. And when that column width decreases, sScrollXInner be automatically reduced and eliminated


    I will explain this by some suggestive images.

    http://i.imgur.com/h6fkk.jpg

    This is in current release (beta 6)
    http://i.imgur.com/L7brO.jpg

    Need sScrollXInner be automatically increased value
    http://i.imgur.com/b9Uwp.jpg

    I hope you understand me
    Thanks and congratulations!
  • allanallan Posts: 63,488Questions: 1Answers: 10,468 Site admin
    @iuliandum: Try disabling sScrollXInner, just use sScrollX. What sScrollXInner is telling DataTables is that you want the width of the table to be whatever you've set sScrollXInner to be - no room for manoeuvre. However, if you remove it, then the table will automatically take up as much width as it needs to, which if I understand correctly, is what you are looking for.

    In addition to this, DataTables will tell you (using console.log - so you would need to be using a browser which supports this, or Firebug lite) if sScrollXInner is not big enough for the table to be correctly displayed and will likely result in misalignment of columns.


    @kkudi: Did you have any luck with that example? It would be great to have this addressed in time for the 1.7.0 release.

    Regards,
    Allan
  • thomasBthomasB Posts: 4Questions: 0Answers: 0
    @kkudi: I had/have the same problem, try creating your datatables first and then do the tabs. I think it has to do with that fact that your tables are invisible when you create the datatables.
    Of course this starts a whole new set of problems concerning resize. Basically the headers don't match the columns anymore:(
  • kkudikkudi Posts: 77Questions: 0Answers: 0
    @thomasB: thanks for your response. by creating the datatables first, do you mean just simply execute the code for datables before the tabs creation code?
  • thomasBthomasB Posts: 4Questions: 0Answers: 0
    @kkudi: yep, but I'm still struggling with my size issues. But those might come from the fact that I'm stuck in a frame with scrolling="no". Don't ask... it's not in my control:)
  • allanallan Posts: 63,488Questions: 1Answers: 10,468 Site admin
    The thing to do here, is to call fnDraw when you display the tab. In this way the sizes will be correctly calculated and the table correctly drawn. The reason it doesn't work off the bat is that the table is hidden, and as such the browser will not be able to calculate the width of the table - hence the misalignment. I'll add an example of how to do this with tabs soon.

    @kkudi: It would be really interesting if you could add:

    [code]
    alert( $(o.nTable).outerWidth() );
    alert( o.iScrollWidth );
    [/code]
    just before the line:

    [code]
    nScrollHeadTable.style.width = $(o.nTable).outerWidth()+"px";
    [/code]
    and let me know what the output is please.

    Regards,
    Allan
  • thomasBthomasB Posts: 4Questions: 0Answers: 0
    @allan: that won't work as I'm saving state and fnDraw() 'forgets' my page. I guess that one could actually be a defect.

    oh and I have a silly workaround where I select each tab in code before calling datatables on it. Seems to work fine, but feels a bit ugly;)
  • allanallan Posts: 63,488Questions: 1Answers: 10,468 Site admin
    edited July 2010
    Try fnDraw(false); which will tell DataTables not to do a complete redraw, but just redraw the current view.

    Edit: actually this isn't quite right either... Try this:

    [code]
    $('#example').dataTable().fnAdjustColumnSizing();
    $('#example').dataTable().fnDraw();
    [/code]

    If this does the job for you, I'll look at providing an automatic draw option for fnAdjustColumnSizing, which I think is the most sensible way forward.

    Allan
  • thomasBthomasB Posts: 4Questions: 0Answers: 0
    Ok thanks seems to work now.
    I have a resizeable 100% width table so I have to call that on window Resize to. Kind of funny to see the columns jump around a bit, but at least it works now. It still goes wrong when I resize it to small ofcourse, but I doubt that is easy to fix and is a minor issue for me at the most.

    Thanks and keep up the good work! :)

    Oh and for some reason I'm not getting the error anymore even though I'm creating the tabs before turning the tables into datatables, can't figure out why.
  • iuliandumiuliandum Posts: 70Questions: 0Answers: 0
    edited July 2010
    Allan, thanks for reply.

    I removed sScrollXInner and I obtained progress but not as I wish.

    sScrollXInner doesn't increases that much so as the width of the nearby columns to remain unchanged in the desired page.

    Back, in the previous page - that diplays horizontal scrolling wasn't necessary the xScroll bar remained displayed and the column width was increased.


    I will explain this by some suggestive images.

    This is initial page:
    http://i.imgur.com/Ejzwj.jpg

    and this are columns width:
    http://i.imgur.com/hXZfU.jpg

    This is the page where the width of a column must grow:
    (you observe how width of adjacent columns changed)
    http://i.imgur.com/V5nPS.jpg
    http://i.imgur.com/CWTsX.jpg

    And now this is the intial page, but where now width of columns is grew and Xscroll bar remains displayed;
    http://i.imgur.com/pCQDe.jpg
    http://i.imgur.com/GoyLL.jpg


    EDIT:
    This is initialize code:
    [code]
    "sScrollY": 253,
    "sScrollX": "102%",
    "bScrollCollapse": false,
    "bAutoWidth": false,
    "aoColumns": [
    { "sWidth": "100px"},
    { "sWidth": "100px"},
    { "sWidth": "100px"},
    { "sWidth": "100px"},
    { "sWidth": "100px"},
    { "sWidth": "100px"}
    ],
    [/code]

    Thanks!
  • allanallan Posts: 63,488Questions: 1Answers: 10,468 Site admin
    @iuliandum: Thanks for the pictures - but I've got to confess I'm getting a bit lost! So basically the problem is that without the sScrollXInner property, the adjacent columns will not resize as you desire?

    I believe that this is due to the way the web-browser handles the tables. What DataTables does is to let the browser draw the table and then calculate the widths from what has been drawn. This is to try and keep the basic behaviour of what the browser is doing the same (so you get similar results). However, the browsers can be a bit funny about how the deal with tables which don't have exactly the right sizes applied (for example the content in your table must be way more than 100px, which has been assigned to it, so the browser tries to compensate. This is something I want to have a look at in future, but it's not a trivial thing to "fix" (since it might be considered to not be broken at the moment!).

    Regards,
    Allan
  • Simon79Simon79 Posts: 8Questions: 1Answers: 0
    @allan: Wow, the new version fixes both issues I reported in the previous thread. Brilliant!
  • kkudikkudi Posts: 77Questions: 0Answers: 0
    edited July 2010
    @allan, apologies for the delay:

    for:

    [code]
    alert( $(o.nTable).outerWidth() );
    alert( o.iScrollWidth );
    [/code]

    I get 0 and -183 respectively in IE7.

    In firefox, safari and opera I get 0 and -183, but it's called again and alerts with 870 and -183 respectively.
  • kkudikkudi Posts: 77Questions: 0Answers: 0
    btw, the problem is solved by having a window.setTimeout(createTable, 10);

    after the tabs have been created and loaded via synchronous ajax.
  • allanallan Posts: 63,488Questions: 1Answers: 10,468 Site admin
    -183!! That's very odd indeed! The '0' is expected, the -183 certainly is not. I've just tried it on my machine with IE7 and it calculates as 17. I've tried this with hidden tabs etc as well. I'd need an example which shows this issue in order to be able to see exactly what is going on. Might you be able to provide one?

    Allan
  • iuliandumiuliandum Posts: 70Questions: 0Answers: 0
    Hi Allan,

    About resize columns.

    Problem is that without the sScrollXInner property, the adjacent columns resized without need to have and the width of affected column doesn't increases that much as it is needed.

    Ex:
    http://i.imgur.com/V5nPS.jpg


    And when come back in the intial page, now the width of columns is grew than initial width and Xscroll remains displayed.

    Ex:
    http://i.imgur.com/pCQDe.jpg


    You know better If you can fix this anormal comportament before release 1.7.0 version.

    Thanks!
This discussion has been closed.