Unlimited, neverending bugs

Unlimited, neverending bugs

ciprian.paunica@gmail.comciprian.paunica@gmail.com Posts: 9Questions: 1Answers: 1
edited August 2017 in Free community support

Hi,

It is very hard to me to writte those words. But, after weeks of working with datatables i'm so angry tahat i just cant stop!

Few months ago, I found datatables as a brilliant way to develop web applications. I read, i test, i try. At the end, i decide to start a new project with datatables.

In the "real world", what i found?

Bugs, bugs,bugs! I'm not willing to have the one million application, but, really???

  • Putting PDF (or whatewer) button killed Page renge sellector?

  • Having columnHide false destroy responsive teble option?

  • Navigation on mobile destroy respoinsive layout?

  • Saerch button is 100 px (or something) wide and nothing can change this value?

  • Adding custom datepicker language not working?

  • Following official datatables examples, including jquerry 1.xx.xxx some thing work, but following similar examples, the 3.xxx..xxx jquery is requaired and the work done before is ruined?

etc! stc! etc!

Guys, i know that this post will be never online (THE COMMENTS ARE MODERATED!) but is absolutely very very frustrating to work weeks on a project based on your solution and found in the end that if i made a small change today the work of yesterday is ruined.

I can give you punctual examples. Punctual, detalied examples. Online. With argumentations.

I will never use datetables. NEVER!

Have a nice bug-founding & resolving ugs years.
Ciprian

Replies

  • kthorngrenkthorngren Posts: 20,141Questions: 26Answers: 4,736
    edited August 2017

    Interesting, your first and only post is a list of issues and complaints. First let me say that I'm not affiliated with Datatables in any way except as a user. Second let me say that support from the developer is second to none. Also there are many users of Datatables that contribute quality information to the forum.

    THE COMMENTS ARE MODERATED!)

    Why would you say that? There is very little moderation of this forum, mostly only to close duplicate posts.

    I can give you punctual examples. Punctual, detalied examples. Online. With argumentations.

    Why did you not post your questions / issues before? The developer is very responsive and if its a true bug will try to provide a timely fix. The developer and other experienced contributors are willing to help and look at your issues. If you still want help please create a new topic for each issue and provide online examples of the problem.

    I will never use datetables. NEVER!

    That's unfortunate for you. Datatables is an awesome product with an awesome support structure. The problem is you didn't take advantage of the support structure and are now frustrated. Again the Datatables community and especially the developer are interested in solving your issues.

    Do you want help with your issues then please post your questions?

    Kevin

  • bindridbindrid Posts: 730Questions: 0Answers: 119

    so much for the whole cant change the button size thing http://jsbin.com/socitiy/edit?html,css,js,output

  • tangerinetangerine Posts: 3,342Questions: 35Answers: 394

    I can give you punctual examples.

    I have no idea what you mean by "punctual", but perhaps English is not your first language. Anyway, you have chosen not to show your examples, so why mention them?

  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin

    Hi,

    Thanks for the feedback. Its always welcome, even if it isn't what I want to hear. Its the only way to make the product better. Others have pointed out that you need to post examples if you have questions, so let me address those which you have mentioned:

    Putting PDF (or whatewer) button killed Page renge sellector?

    Sounds like the Q. How can I show the page length select when using Buttons? FAQ.

    Having columnHide false destroy responsive teble option?

    Hiding a column will cause Responsive not to work? It appears to be working no problem here.

    Navigation on mobile destroy respoinsive layout?

    It shouldn't. Can you link to an example please.

    Saerch button is 100 px (or something) wide and nothing can change this value?

    @bindrid showed how this can be done.

    Adding custom datepicker language not working?

    I'm not sure how that is a DataTables issue, since DataTables core doesn't contain a date picker. Again, please link to an example.

    Following official datatables examples, including jquerry 1.xx.xxx some thing work, but following similar examples, the 3.xxx..xxx jquery is requaired and the work done before is ruined?

    DataTables should be compatible with all versions of jQuery from 1.7 onwards, including 2.x and 3.x. If you have found an issue, please let me know so I can resolve it and make it better for everyone.

    Allan

  • ciprian.paunica@gmail.comciprian.paunica@gmail.com Posts: 9Questions: 1Answers: 1
    edited August 2017

    So, let's start. I tottaly drop my project and i start a "just-for-fun" new one from zero.

    1. download datatable CSS and JS file, include in my page:


      link href="../vendor/datatable/datatables.css" rel="stylesheet"


      script src="../vendor/datatable/js/datatables.js"

    Everything is fine. My first tought was to order dates by first column of the table. So, i find this link:

    https://datatables.net/examples/basic_init/table_sorting.html

    and i added the example code to my <SCRIPT>:

    $(document).ready(function() { $('#avertizariLista').DataTable(); "order": [[ 0, "desc" ]] } );

    What a surprise: nothing happend!

    After one hour of checking again my table dates, PHP script, mySQL table structure etc. etc. i try something stupid: remove the quotation marks of ORDER word.

    Another huge surprise: it works!

    So, why should i spend hours to check my entire project structure / scripts / database for bugs, with "what is wrong?..." in my mind, just to find that quotation marks is the devil? Is your example, not my.

    so, i update the <SCRIPT> to:

    $(document).ready(function() { $('#avertizariLista').DataTable(); order: [[ 0, "desc" ]] } );

    And the job is done :)

    I will be back with my next issue.

  • ciprian.paunica@gmail.comciprian.paunica@gmail.com Posts: 9Questions: 1Answers: 1
    edited August 2017

    My next tought: make table responsive. Very easy! I found this:

    https://datatables.net/extensions/responsive/init

    So, i add one line to my <SCRIPT>:

    $(document).ready(function() { $('#avertizariLista').DataTable(); responsive: true, order: [[ 0, "asc" ]] } );

    Another surprise: Nothing happend again!

    Mention: when i downloaded the CSS and JS files, i choose the Concatenate option - SINGLE FILE - wich, according with the explanation, will create a single file including responsive options.
    _
    Performance is key for web-sites and applications, and one method to improve performance (in HTTP 1.x) is to reduce the number of requests that a client makes to the server. The download builder can combine all of the individual files into a single file for you using this option. _

    So, again, what is wrong? Did i miss some quotation marks again? but there are none! so i put it. :)

    "responsive" : true,

    no, is not working

    so, what is the problem? maby the CSS and JS i just downloadaed is not ok. so, lets download the dataTables.responsive.min.js and responsive.dataTables.min.css files and include in my project.

    so, i add this:

    ../vendor/datatable/css/responsive.dataTables.min.css
    ../vendor/datatable/js/dataTables.responsive.min.js

    What a new big surprise! NOTHING HAPPEND?

    What is wrong? Please hepl me.

    Close browser, restart and it works. So, i miss the necessary files :)

    Then, why is that "Concatenate" option???

    Why shoul i check again my entire project (hours!) just to find that The download builder can combine all of the individual files into a single file for you using this option it was not what is written?

  • kthorngrenkthorngren Posts: 20,141Questions: 26Answers: 4,736
    $(document).ready(function() {
     $('#avertizariLista').DataTable(); 
    order: [[ 0, "desc" ]] } );
    

    This is incorrect. You need to define the initialization options within the DataTable function. Like this:

    $(document).ready(function() {
      $('#avertizariLista').DataTable({
        order: [[ 0, "desc" ]] 
      });
    });
    

    You can have quotes around order if you wish. Take a look at this example with the quotes:
    http://live.datatables.net/cibihuji/1/edit

    Kevin

  • kthorngrenkthorngren Posts: 20,141Questions: 26Answers: 4,736

    Another surprise: Nothing happend again!

    $(document).ready(function() { $('#avertizariLista').DataTable(); responsive: true, order: [[ 0, "asc" ]] } );
    

    Same problem. You need to initialize the Datatable options within the DataTable function.

    Kevin

  • ciprian.paunica@gmail.comciprian.paunica@gmail.com Posts: 9Questions: 1Answers: 1

    a small step for me, a big-one for mankind:

    $(document).ready(function() { $('#avertizariLista').DataTable({ responsive: true, order: [[ 0, "desc" ]] }); });

    next-one, saveState

    1. NOT WORKING
    $(document).ready(function() { $('#avertizariLista').DataTable({ responsive: true, saveState: true, order: [[ 0, "desc" ]] }); });
    1. NOT WORKING
    $(document).ready(function() { $('#avertizariLista').DataTable({ responsive: true, order: [[ 0, "desc" ]], saveState: true }); });
    1. NOT WORKING
    $(document).ready(function() { $('#avertizariLista').DataTable({ responsive: true, order: [[ 0, "desc" ]], }); saveState: true });
    1. SOMETHING FINNALY WORK

    frmo this example: https://datatables.net/examples/basic_init/state_save.html my <SCRIPT> become:

    $(document).ready(function() { $('#avertizariLista').DataTable( { stateSave: true } ); } );

    but my column ordering and responsive option is gone. I must forget about that options, Saving state is more important :)

  • kthorngrenkthorngren Posts: 20,141Questions: 26Answers: 4,736

    Your non-working examples have saveState. The option is stateSave. You reversed the names. You should be able to have the order and responsive with stateSave.

    Kevin

  • ciprian.paunica@gmail.comciprian.paunica@gmail.com Posts: 9Questions: 1Answers: 1
    edited August 2017

    thx, Kevin. I think i must turn this discussion into a constructive one; in that way that a new commer in DataTables system to have something to learn.

    So, starting again. I have a table generated from an mySQL table. That work fine. My goal with DataTable is to:

    1. default ordering the table from his first column
    2. this first column must be hidden but searcheable
    3. have the PDF and XCEL buttons in table header
    4. stateSave active
    5. responsive option active
    6. change default language into a server-saved JSON file (like: language: {"url": "xxx/xxx.json"},)
    7. fix table header based on a fixed page header (body:margin-top:XXXpx)
    8. responsive search input (not in pixels, but in percent)
    9. custom placeholder for search input (i want to have a placeholder like "click here to find recorde")

    we can start from here:

        $(document).ready(function() {
        var table = $('#avertizariLista').DataTable({
    
                footerCallback: function (row, data, start, end, display) {
                    var api = this.api();
                    $( api.column( 5 ).footer() ).html(
                    api.columns( 5, {page:'current'} ).data().sum()
                    );
                },
    
                columnDefs: [ { "targets": [ 0 ], "visible": false}],
    
    //          stateSave: true,
    
    //          responsive: true,
    
                "order": [[ 0, "desc" ]],
                
    
                pagingType: "full",
    
    
                language: {"url": "../vendor/datatables/romanian/romanian.json"},
    
            dom: 'Blfrtip',
            lengthMenu: [
                [ 2, 50, 100, -1 ],
                [ '2', '50', '100', 'TOT' ]
            ],
            buttons: [
                {
                    extend:    'pdfHtml5',
                    text:      '<i class="fa fa-file-pdf-o"></i>',
                    titleAttr: 'PDF'
                },
                {
                    extend:    'excelHtml5',
                    text:      '<i class="fa fa-file-excel-o"></i>',
                    titleAttr: 'Excel'
                },
    
            ]
    
            });
    
            $('#proformeDeEmis').DataTable({
                stateSave: true,
                responsive: true,
                language: {"url": "../vendor/datatables/romanian/romanian.json"},
                dom: 'Bfrtip',
                buttons: ['excel', 'pdf']
            });
    
            new $.fn.dataTable.FixedHeader( table );
    
        });
    

    Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin

    Can you link to a page showing the issue please? The above code looks like it should run okay - although I would suggest you use fixedHeader rather than creating a new instance - its just a little easier.

    What from your list of 9 requirements isn't working?

    Allan

  • ciprian.paunica@gmail.comciprian.paunica@gmail.com Posts: 9Questions: 1Answers: 1

    HI Allan, i manage to resolve all issuses. It seems like my problem was browser-reloaded related, as i writte in other post.

    I think this post can be declared closed.

    All the best

  • alexpersonalexperson Posts: 3Questions: 0Answers: 0

    Sorry, but I completely agree. I regret having invested so much time into this library. The documentation is simple enough, but so often it just doesn't work. Parameters are ignored, extensions like column re-ordering doesn't work.

    Every time there is an issue, someone expects there to be a JS-fiddle, which is obviously unfeasible for large data sets or server-side rendering.

    With the huge amount of re-factoring in ridiculous parameter names I've seen in earlier versions, I would bet the code-base is a total mess and has serious organization problems, lack of testing, poor overall design, non-maintainability, etc.

    I understand that this software is open-source and free to use, but I'm getting increasingly frustrated with these (mostly Javascript) products have have very pretty websites, corporate names of "users", nice tiny one-off examples and then flat-out fall apart at scale. I think it's false advertising. It's "advertising" a bunch of nice, hardly tested, poorly architecture features that don't go well together and have tons of compatibility issues on top of it (honestly hugely typical of Javascript code-bases and front-end development in general).

    My biggest gripe is the community here. There are tons of bugs in this library and everyone knows it, and out of nowhere, issues are closed because maintainers don't want to deal with it (Looking at you Allen, sorry, I appreciate all you do, but I've seen you close tons of issues with responses like "Just RTFM" when obviously the it's a serious bug and in my opinion, doing it without admiring that there are actually issues. Not being to solve the problem is one thing. Pretending that everything is fine and closing the issue is LYING.

    I would STRONGLY ADVISE anybody that has any semi-critical or even semi-large data set. So far, it's been a huge waste of time. I'm a full-stack developer and work on a lot of things, and for some reason I can't seem to learn to avoid these over-promising horrible front-end libraries that are basically the equivalent of putting a nice paint-job on a car that's actually a lawn-mower and barely drives off the lot after you've signed the lease. With all the other systems I have to deal with, nothing comes close to the amount of frustration and time I waste on front-end libraries like these.

    DATA-TABLES DOESN'T PERFORM WELL IN THE REAL WORLD. YOU WILL WASTE YOUR TIME AND HAVE TO IMPLEMENT YOUR OWN SYSTEM ANYWAY. YOU'VE BEEN WARNED.

  • alexpersonalexperson Posts: 3Questions: 0Answers: 0

    Here, since this support form is useless, I dug into datatables.js. I found a bug for you. This is regarding ajax.reload(null, false) still resetting paging when I EXPLICITLY tell it not to. I suspect it worked in a small example because a race-condition happened in your favor.

    In version 1.10.18:

    BUG NUMBER ONE:

    Around line 7634, _api_register is doing:

        ```_api_register( 'ajax.reload()', function ( callback, resetPaging ) {
                return this.iterator( 'table', function (settings) {
                        __reload( settings, resetPaging===false, callback );
                } );  
        } );```
    

    This is called again on line 7557:

        ```var __reload = function ( settings, holdPosition, callback ) {
                // Use the draw event to trigger a callback
                if ( callback ) {
                        var api = new _Api( settings );
    
                        api.one( 'draw', function () {
                                callback( api.ajax.json() );
                        } );  
                }```
    

    And the value holdPosition is not carried through. I console logged the value in the part 7634 and confirmed the value was false, however, when 7557 is called, the value is not false. Because of this, resetPaging aka holdPosition (great naming consistency btw, all you have to do is s/resetPaging/holdPosition/g to refactor) is not carried through.

    This causes the bug ajax.reload(null, false) to break! It doesn't work!

    I don't know what this.itterator is in this whole codebase and I don't want to know. I also don't know why that function has a parameter that has a comparison operator, but hey, I'm not a Javascript guy!

    BUG NUMBER TWO:

    In __reload, depending on the _fnDataSource( settings ) == 'ssp', some steps are done and finally _fnReDraw( settings, holdPosition ); is called, however, when the ssp condition is false, _fnReDraw( settings, holdPosition ); gets called TWICE! Why it get's called twice? I don't know! You tell me!

    In the first time it's the holdPosition is at least passed through from __reload to _fnDataSource (even though it's not passed through from _api_register to __reload. But if it's manually set there, it will at least carry through to _fnDataSource. This is fine and dandy, however, something else is calling that function again, this time without the same value for hold parameter.

    My guess as to why this breaks is a race-condition, but from my debugging, I've proved the value isn't even passed as it was intended. My guess is that your small testing case JUST HAPPENED to work because the race-condition went in your favor.

    I've been able to solve this bug myself by taking the non-minified version and hard-coding in that holdPosition variable, never letting settings._iDisplayStart = 0; to be called, but the code is wrong and configuration is shaky at best. I personally don't really like the code base.

    Please fix your bug.

  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin

    Hi @alexperson - I'm sorry I've not been able to meet your expectations. I've added a reply to your other thread regarding the two issues you've reported above. If we could continue the discussion on those two points there, so I can fix them, that would be great.

    Thanks,
    Allan

  • Loren MaxwellLoren Maxwell Posts: 382Questions: 93Answers: 10

    I'm late to the party (just now saw this post), but I admire and applaud the support @allan and many others have given here on the forums, in the documentation, and in the software itself.

    This very thread demonstrates that even in the face of insufferable obnoxiousness, rudeness, and condescension, the DataTables community with Allan at the vanguard rallied to provide the best support that it could and it looks to me to have helped resolve every issue the OP had, just the same as if he had simply asked using the basic manners a second grader should possess. In fact, it appears most (if not all) of the issues were of his own doing, not because of "Unlimited, neverending bugs" . . .

    That's true professionalism on the part of the community.

    Anyway, DataTables, all the extensions, the plugins, all their voluminous documentation and examples, the blog, etc., aren't and never will be perfect, but I'd challenge anyone to meet that standard for a complex library that provides as many robust options as what is provided for here.

    In fact, I'd challenge anyone to get on github, fork the DataTables library, make the improvements you'd like to see, and do a pull request so the whole community can benefit, just as many others have done to improve Allan's fantastic library.

    I for one am appreciative of everyone's efforts and can unequivocally state my sites would not have been nearly as good without this library and I am always grateful for the day I stumbled across it. I use several other libraries as well but if I was forced to choose just one, DataTables would be the clear winner.

    I'll close by stating that IMO, the natural emotional state of a programmer is frustration.

    Often what seems to be straightforward is challenging to implement and the reasons for the difficulty are not always easy to discern, especially when simple things like a missing quote can cause nothing to work at all and take hours upon hours to uncover.

    I personally find the experience ultimately worth it when I finally get something working the way I would like, but if someone can't suffer through frustration without being able to control their emotional state enough to muster a smidgen of politeness when asking for help, then perhaps programming isn't the right fit for you.

    Oh . . . I didn't even mention this is all for free . . . :smile:

This discussion has been closed.