DataTables 1.8 beta 3 now available
DataTables 1.8 beta 3 now available
Hello all,
Continuing the DataTables 1.8 beta series, I'm very pleased to announce the availability of 1.8 beta 3.
Beta 3 Package download: http://datatables.net/releases/DataTables-1.8.0.beta.3.zip
What's new in 1.8: http://datatables.net/new/1.8
Upgrade notes: http://datatables.net/upgrade/1.8
Original 1.8 announcement: http://datatables.net/forums/comments.php?DiscussionID=4852
This latest beta of DataTables 1.8 focuses on stabilising the new features that are being introduced as part of the 1.8 series, and includes a number of bug fixes particularly around the areas of deferred rendering and TH elements in the table body. Also of note is that I've rewritten the algorithm used for calculating column widths when x-scrolling is enabled, and other more general improvements in column width calculation when scrolling is not enabled.
In addition to the bug fixes, there are a couple of low impact new features which are introduced in this beta, including:
- The ability to have default content for a column (an edit image is an option for example), which is used when mDataProp is null
- A new callback function called 'fnPreDrawCallback' which can be used to pre-process or cancel a draw
- A new language option called 'sLoadingRecords' which is used when Ajax sourced data is being loaded.
I'd encourage everyone to try out the beta and let me know if you run into any upgrade problems, or any other issues with the latest beta so I can start thinking about wrapping the 1.8 beta series up and releasing 1.8.0 :-)
Enjoy!
Allan
Continuing the DataTables 1.8 beta series, I'm very pleased to announce the availability of 1.8 beta 3.
Beta 3 Package download: http://datatables.net/releases/DataTables-1.8.0.beta.3.zip
What's new in 1.8: http://datatables.net/new/1.8
Upgrade notes: http://datatables.net/upgrade/1.8
Original 1.8 announcement: http://datatables.net/forums/comments.php?DiscussionID=4852
This latest beta of DataTables 1.8 focuses on stabilising the new features that are being introduced as part of the 1.8 series, and includes a number of bug fixes particularly around the areas of deferred rendering and TH elements in the table body. Also of note is that I've rewritten the algorithm used for calculating column widths when x-scrolling is enabled, and other more general improvements in column width calculation when scrolling is not enabled.
In addition to the bug fixes, there are a couple of low impact new features which are introduced in this beta, including:
- The ability to have default content for a column (an edit image is an option for example), which is used when mDataProp is null
- A new callback function called 'fnPreDrawCallback' which can be used to pre-process or cancel a draw
- A new language option called 'sLoadingRecords' which is used when Ajax sourced data is being loaded.
I'd encourage everyone to try out the beta and let me know if you run into any upgrade problems, or any other issues with the latest beta so I can start thinking about wrapping the 1.8 beta series up and releasing 1.8.0 :-)
Enjoy!
Allan
This discussion has been closed.
Replies
What's the "Default content for a column"?
Does or can this feature address the null value issue too?
To eliminate the null values is pretty nasty.
I am afraid it will burden the server if the JSON null pre-process is performed on the server side.
And if it is processed on the client side, there're so many places need to fix :(
It is strange that no other people meet with and report this issue while we are discussing this.
I just wonder whether others can handle this neatly.
If this change does break backwards compatibility for a large number of applications, then I will look at altering DataTables to provide null transformation as an option - which is why I would encourage as many people as possible to test 1.8 and see how it performs in their application :-) particularly as I hope to move towards a release of 1.8.0 reasonably soon.
Allan
I wanted to give you a heads up and thank you for the update.
I haven't tried this version yet, but, while trying to implement "ColVis" functionality, found a problem in that plugin. It's still version 1.0.4 in this beta (same in version 1.7.6), so, this problem will occure in stable too if used with current stable version of jQuery >1.6 instead of the bundled version, 1.5.1.
Since the introduction of jQuery 1.6 (which I started to use last week) there has been a major change about how .attr() method works on checkboxes. So, since then, the buttons to enable and disable columns would just not work. ColVis plugin would need a change in method _fnDomColumnButton, so that lines 454 and 457 check/set the checked attributes via new .prop() method rather than .attr(). This change will break compatibility with older versions of jQuery though :-/
I'm posting this in the beta thread because I don't know your current release cycle, especially regarding the bundle of DT with newer versions of jQuery.
Regards,
fha
PS: Please also refer to http://blog.jquery.com/2011/05/03/jquery-16-released/ if that particular change is unknown to you.
Thanks for the reply.
Since this null value issue does impact my applications a lot, fixing them will take quite some considerable time, and currently tasks overflows my scheduler ^__^, thus I will sit back and wait for the final release.
If I am the 'single case', I will consider fixing this manually here after release is born.
@fha: Thanks for flagging this up. I was aware that the jQuery folks had changed the $().prop and $().attr methods in 1.6 - and they've not reverted them in 1.6.1: http://ejohn.org/blog/jquery-16-and-attr/ . I've not really tested 1.6.x yet, so I'd be interested to know how 1.6.1 goes for you.
I'm a bit surprised that 1.6.0 did actually break ColVis since the only place that it uses it is for the 'checked' property of the checkboxes. This is probably part of the problem the jQuery team face since checked is valid as both an attribute and a property...
Allan
in general, DT works just fine with jQuery 1.6.1. I came across one problem with Ajax which interferes with an old "loading"-plugin I used (I use mostly serverside processing of tables), but didn't have time for evalutation of the real cause of that problem yet. I'll let you know if I find out that DT is the reason :-)
Regards,
fha
I'm pleased to see that datatables is offering more / better server-side support. Since often the data changes outside of the datatables UI, I find myself refreshing the entire page to see the new data. Any chance you could seamlessly integrate a "Refresh" button (e.g. http://www.iconspedia.com/icon/table-refresh-icon-22001.html). It feels like one belongs there, and I'd certainly use it a lot in testing but also in production. (Actually, in production I might tie it to a timer and auto-refresh the data periodically, but it'd be nice to have a manual option integrated and available).
Thx,
Tac
@Tac: A refresh button is already quite possible using either the fnDraw API function (when using server-side processing) or http://datatables.net/plug-ins/api#fnReloadAjax when using a Ajax sourced data. All you need to do is create a tag and attach an event handler to it to call one of these API methods. This allows a lot more flexibility than having it in the core, and also keeps the core down to a sensible size.
Regards,
Allan
Anyway, I see now that the real issue isn't the couple of lines of code to add the refresh button to the UI, but rather that the fnReloadAjax is a plug-in and not part of the core, so it wouldn't make sense to add the UI element to the core.
Thx.
Allan
Just upgraded to the B3 and noticed a new problem, which is one of the "fixes" judging by the release notes. Basically, all of my tables now display the "Loading..." text even if there is no data. I assume this is due to my using json objects but I don't send a server request for these, any objects I'm going to have are loaded prior to the table being generated so if the empty array is provided and empty it should display the no data message.
-Adam
Thanks,
Allan
I just downloaded 1.8 beta 3 and I have everything working except I'm having some issues with the TableTools plugin. I noticed that this plugin is not bundled in the /extras directory in this release. Is that by design?
I went ahead and downloaded the latest plugin and still experiencing issues... not sure if it's been completely tested with 1.8 beta 3?
I designed to rollback to 1.7.6 for some moment for the null value issue.
I will check back later.
Regards,
Allan
I can recreate that same situation with a normal self contained (and well formed) table, with the stock beta package (no additional plug-ins or changes). BUT ONLY when I provide a sSearch parameter on initialization that DOES NOT MATCH anything in the database.
I'm sure that there are other situations, but I thought that this one might help track it down.
Just in case it's a very strange combination of settings, here's my particular initialization file.
[code]
$(document).ready(function() {
$('#mydatatable').dataTable( {
"bPaginate": false,
"bLengthChange": false,
"bFilter": true,
"bSort": true,
"bInfo": false,
"bAutoWidth": false,
"aoColumns": [
{ "bSearchable": false },
{ "bSearchable": false },
null,
{ "bSearchable": false },
{ "bSearchable": false },
{ "bSearchable": false },
],
"oSearch": { "sSearch": "fakeTextThatDOES_NOT_EXIST_Anywhere_IMPORTANT", "bRegex": false, "bSmart": true },
} );
} );
[/code]
Note this is trivial and I wouldn't even mention it except that it may help track down Gleeble's permanent "loading" message on an empty data set...?
[code]
Description
Date
Loading...
//<![CDATA[
function taskPopUp(actionUrl, actionId) {
$('#taskDialog').load('/root' + actionUrl).dialog('open');
}
$(document).ready(function() {
var dataRows = [];
var isLongData = dataRows.length > 10;
$('#taskTable').dataTable( {
"aaData" : dataRows,
"bInfo" : isLongData,
"bLengthChange": isLongData,
"bPaginate": isLongData,
"aoColumns": [{"mDataProp": "description"},
{"mDataProp": "dateAdded", "stype" : "date",
"fnRender" : function(obj) {
return formatDate(obj.aData.dateAdded);
}}
],
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
var td = $("td", nRow).first();
var txt = td.text();
td.text('');
if(aData.modal) {
$('',{
text: txt,
id: "task_" + aData.taskActionTargetId,
href: '#',
click: function() {
taskPopUp(aData.taskActionUrl, aData.taskActionTargetId);
}
}).appendTo(td);
} else {
$('',{
text: txt,
id: "task_" + aData.taskActionTargetId,
href: "/root" + aData.taskActionUrl
}).appendTo(td);
}
return nRow;
}
} );
$.subscribe('dialogClosed', function(event,data) {
$("#taskDialog").html('');
});
})
//]]>
[/code]
[code]/* if there is an ajax source load the data */
2377 if ( oSettings.sAjaxSource !== null && !oSettings.oFeatures.bServerSide ) [/code]
The main issue I am having and was trying to work around is that when I load my datatable currently I will get the loading string in the datatable box, where the preference would be to have the empty message. There is logic in the init block that says if the sAjaxSource is set to "" then use the empty message, but I blow up with an alert when setting that option do to the line above. bServerSide is set to false.
I do have a workaround in that I can not set the sAjaxSource property at all and can call datatable.fnClearTable(); right after initializing but wanted to post as the above seemed like a defect.
In DataTables 1.8 there is a new language string called "sLoadingRecords" which you can set to be an empty string if you don't want any message when the table is loading.
Allan
@pgalgano: This might have effects your results as well!
I've just committed a fix and it is available as the "nightly" on the downloads page ( http://datatables.net/download ).
Regards,
Allan
I applied the following diff to the "complex header" example:
[code]
11a12,14
>
>
>
13a18,19
>
>
16a23
> "sDom": 'RC<"clear">lfrtip',
[/code]
Reordering the columns sort-of works, but appears to be buggy. I can grab and drag the "Engine version" column header, and when dragging it outside of the "Details" colspan, the drop-target marking blue line appears even though I can't drop there. (Nothing happens after the drop); Similarly, the "Browser" column-header can be dropped inside the "Details" colspan, between those two columns, but it ends up on the other side of the "Details" double-column (where my beef is not where it ends up, but the fact that the drop-target appears where it cannot be dropped).
Dragging the "Engine version" header appears to actually drag the "Browser" header (the text of the dragged item is "Browser", and dropping it moves the browser column, not "Details" or "Engine version").
Is support for ColReorder with colspan/rowspan (complex headers) planned for 1.8? Are the issues described above known bugs?
Thanks in advance,
Daniel Abel
I'm not too surprised that ColReorder with complex headers doesn't work quite as expected I'm sorry to say. There isn't any code in ColReorder which would allow, for example, a cell with a rowspan of 1 to suddenly become a column with a rowspan of 2. This is something for the ColReorder plugin to address in a future version I think, so not something that will be in or hold back the DataTables 1.8 release.
Regards,
Allan