Upgrading to 1.6+

Upgrading to 1.6+

Phil HPhil H Posts: 20Questions: 0Answers: 0
edited May 2010 in General
Hi Allan,

Just a couple of questions for you

1 .. If I have a form with two tables, one with 4 columns and with 6 how would I specify it ?. prior to 1.6.1 it did not really matter but now I guess it does to prevent the counting error.
2 .. I have a form that has a DataTable towards the bottom, and have some links nearer the top ... if a link is clicked before the table finishes loading you get the counting error .. if the table finishes loading there is no error.This happens even if the columns definition is correct, is there a way around that ?
3 .. Would it not be possible to write the message to the javascript error console rather than via a message box to the screen?. This is really not a message that the end user needs to see ?

Many thanks
Allan

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    1. If you are giving it aoColumns, then you need to initialise each table separately rather than a single initialiser. aoColumns must match exactly what the number of columns in the target table(s) are or you'll hit this error. DataTables 1.7, for which I hope I'll be able to release a beta for reasonably soon) will help to address this: http://datatables.net/forums/comments.php?DiscussionID=1486

    2. I've not encountered this yet myself but it sounds like something I very much need to look into! It might need an unload handler or something like that... Added to the 1.7 to do list... :-)

    3. It would certainly be possible, but many developers wouldn't see a message printed to the console... The key thing here is that these warnings should never occur for an end user (the one that occurs in point 2 is a bug that needs to be addressed!) and the fact that they are fairly 'brutal' is to make the developer address them asap.

    Regards,
    Allan
  • Phil HPhil H Posts: 20Questions: 0Answers: 0
    edited May 2010
    Hi Allan,

    Thanks for your comments.

    1. So just to be sure I understand this .... if I have 2 tables on the same pages ... rather than calling them both as DataTable such as
    [code]
    $btype = ".dataTable" ;
    $bdata = '"bPaginate": false,"bLengthChange": false,"bInfo": true,"bFilter": false,"sPaginationType": "two_button", "bSort": false, "iDisplayLength": 100, "bAutoWidth": false' ;
    [/code]I need to
    [code]
    $btype = ".dataTable" ;
    $bdata = '"bPaginate": false,"bLengthChange": false,"bInfo": true,"bFilter": false,"sPaginationType": "two_button", "bSort": false, "iDisplayLength": 100, "bAutoWidth": false' ;
    $btype1 = ".dataTable1" ;
    $bdata1 = '"bPaginate": false,"bLengthChange": false,"bInfo": true,"bFilter": false,"sPaginationType": "two_button", "bSort": false, "iDisplayLength": 100, "bAutoWidth": false' ;
    [/code]2. I saw you comments about raising issues against Webkit & Mozilla, I guess that this will take time to get through their processes and a fix be implemented in a future release.

    3. Due to 2 above and the fact that there must be lots of code out there that is making DataTables do exactly what is needed and will need to be re-written before moving to 1.6 due to the counting issue, and from a number of posts in the forum I would ask again if the message could be written to the JavaScript error console rather than the screen, I know my code is incorrect and has been since its inception and needs to be fixed and it will be, ..... but as the tables format correctly I cant justify doing it until the next upgrade, but I would like to use 1.6 as it has several fixes and speed ups.

    A great tool, with great support

    Regards
    Phil
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi Phil,

    1. Sorry - I misunderstood. If you are calling with that identical parameter set, then you should be able to do it in a single call - $('.dataTable').dataTable(...); - for example. Only if the parameter set is different do you need to do it separately - I had thought you were using aoColumns - that is obviously not the case so you are "safe".

    2. I'm not sure that the browsers will fix this actually. It does seem wrong to me, and the Webkit guys seem to agree, but in the bug report Mozilla suggest that they see this as a feature more than a bug.

    3. I think you are absolutely correct and this is going to be the only way around the problem. In 1.7 final I'll be writing the message to console.log if the method exists. If not, then nothing will happen (although the table will break...). If you have 1.7, then there is a _fnLog function which is the only place DataTables calls alert() now. You can just comment that line out in the beta release.

    Regards,
    Allan
  • Phil HPhil H Posts: 20Questions: 0Answers: 0
    Many thanks Allan
This discussion has been closed.