Searchpanes error after upgrade to latest build: Requested unknown parameter 'total' ....

Searchpanes error after upgrade to latest build: Requested unknown parameter 'total' ....

itajackassitajackass Posts: 165Questions: 49Answers: 3
edited August 26 in Free community support

Hi, after downloading and updating datatables to latest build with this config:

JSZip 3.10.1, pdfmake 0.2.7, DataTables 2.1.4, Buttons 3.1.1, Column visibility 3.1.1, HTML5 export 3.1.1, ColReorder 2.0.4, FixedColumns 5.0.1, FixedHeader 4.0.1, Responsive 3.0.2, RowGroup 1.5.0, RowReorder 1.5.0, SearchPanes 2.3.2, Select 2.0.5

I get this popup warning:

Requested unknown parameter 'total' for row xxxxx, column yyyyyy ......

for each columns i've set in this way:

        {
       targets: [ 'columnX', 'columnY', 'columnZ' ],
            searchPanes: {
                show: true
         }
        },

So, in this case, i get 3 popups!

If I revert to myprevious build, no errors:

JSZip 3.10.1, pdfmake 0.2.7, DataTables 2.0.8, Buttons 3.0.2, Column visibility 3.0.2, HTML5 export 3.0.2, ColReorder 2.0.3, FixedColumns 5.0.1, FixedHeader 4.0.1, Responsive 3.0.2, RowGroup 1.5.0, RowReorder 1.5.0, SearchPanes 2.3.1, Select 2.0.3

The problem is that i can't replicate the error to a live.datatables website... i don't know why.
I don't know "total" parameters what is ....

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin

    Are you loading a language file? There was a similar issue recently - see here.

    Allan

  • itajackassitajackass Posts: 165Questions: 49Answers: 3

    yes i'm using italian lang

  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin
    Answer ✓

    That will do it - hopefully the solution in the other thread will help fix it for you.

    Allan

  • itajackassitajackass Posts: 165Questions: 49Answers: 3
    edited September 5

    Thanks, fixed using nightly of searchpanes. But now i'm still get another error but i don't know what plugins causing it (most probably rowreorder after some test).

    Still about language files: if I remove language, error disappear:

    DataTables warning: table id=tabella - Requested unknown parameter '1' for row 0, column 1
    

    My actual build is ( + searchpanes nightly ):

    JSZip 3.10.1, pdfmake 0.2.7, DataTables 2.1.5, Buttons 3.1.2, Column visibility 3.1.2, HTML5 export 3.1.2, ColReorder 2.0.4, FixedColumns 5.0.1, FixedHeader 4.0.1, Responsive 3.0.3, RowGroup 1.5.0, RowReorder 1.5.0, Select 2.0.5  
    
  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin

    If you could link to a test case showing the issue please, I'll take a look into it.

    Allan

  • itajackassitajackass Posts: 165Questions: 49Answers: 3

    tried to create an example here but, i don't know why, problem not appear :(

    https://live.datatables.net/xapilela/1/edit
    

    on my localhost (wamp) it also works!!!

    on my webapp (live) is not working: DataTables warning: table id=tabella - Requested unknown parameter '1' for row 0, column 1

    :s

  • kthorngrenkthorngren Posts: 21,450Questions: 26Answers: 4,975

    Have you followed the troubleshooting steps at the link in the error?
    https://datatables.net/manual/tech-notes/4

    Let us know what you find.

    Kevin

  • itajackassitajackass Posts: 165Questions: 49Answers: 3

    Ok i've found that the problem is an outdate version of my it_IT.json file.
    The strange things is that using my localhost or live.datatables.net no problem using old json lang file.... but on my production website I get the error! :(

    DataTables warning: table id=tabella - Requested unknown parameter '1' for row 0, column 1
    

    live debug:

    https://live.datatables.net/xapilela/2/edit
    

    Anyway this is my old lang file causing error: https://raw.githubusercontent.com/itajackass/datatables-files-test/main/Italian_broken_file.json

    Only difference is some missing strings from latest here: https://cdn.datatables.net/plug-ins/2.1.5/i18n/it-IT.json

  • itajackassitajackass Posts: 165Questions: 49Answers: 3

    Forget my latest comment. i've not found the problem yet

  • itajackassitajackass Posts: 165Questions: 49Answers: 3
    edited September 6

    After some test, the problem occurs only on production server using:

        $.extend( $.fn.dataTable.defaults, {
        language: { url:  './assets/plugins/advanced-datatable/Languages/Italian.json' }
    });
    

    If I remove $.extend all works great (of course in english default language)

    If I set lang directly on initialization all works great:

     var example = $('#example').DataTable( {
               language: { url:  './assets/plugins/advanced-datatable/Languages/Italian.json' },
               ....
    

    So the problems seems to be $.extend( $.fn.dataTable.defaults, but I repeat, using my wamp localhost or live.datatables.net i can't reproduce the problem... only on my production server it get error :(

    It seems a problem like this one: https://datatables.net/forums/discussion/78509/searchpanes-raises-an-error-if-fn-datatable-defaults-contains-language-url

  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin
    Answer ✓

    Have you tried using the nightly build, rather than the current release?

    The nightly has this commit in it which should fix the issue.

    Allan

  • itajackassitajackass Posts: 165Questions: 49Answers: 3

    Hi, do you know when the nightly of SearchPanes will be merged/available to be downloaded with "download builder" so I think a v2.3.3 ? thanks

  • itajackassitajackass Posts: 165Questions: 49Answers: 3

    Ok i've finally found and replicate the problem with live.datatable.net:

    https://live.datatables.net/xapilela/4/edit
    

    If you see my example using firebug you get an error "Uncaught ReferenceError: alert is not defined" (because alert is "blocked" from the live.datatable.net site.

    But on my webapp the alert is "DataTables warning: table id=tabella - Requested unknown parameter '1' for row 0, column 1"

    Now if you comment "language:" option, no errors in console occurs.

    The problem appear only if I call a function ( example: my_custom_func() ) after initilization of the table and inside the funtion i need to operate with table (in this case clear all rows)

  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin
    Answer ✓

    Thanks for the test case. The issue is that your table initialisation is async due to the use of the language.url option, but your my_custom_func() function is executed synchronously.

    It issue here has nothing to do with SearchPanes (indeed, although you include the code for SP on the page, it isn't used).

    The answer is to use ready() to wait for the table to load before you perform any operations on it:

    example.ready(function () {
      my_custom_func();
    });
    

    https://live.datatables.net/xapilela/6/edit

    Allan

Sign In or Register to comment.