'Unknown Parameter' common issue

'Unknown Parameter' common issue

qforguesqforgues Posts: 4Questions: 1Answers: 0

I have a pop-up that also errors out the table to list all. Page -> http://budko.easyjobtracker.com/special_view.php

This question has an accepted answers - jump to answer

Answers

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75
    edited October 2015

    This is the relevant code you have right?

    jQuery('.js-dataTable-full').dataTable({
        columnDefs: [ { orderable: false, targets: [ 4 ] } ],
        pageLength: 10,
        lengthMenu: [[5, 10, 15, 20], [5, 10, 15, 20]]
    });
    

    Next time, post that if you can, to save some time.

    Also, that table only has 3 columns...

    Also, did you read the error it prompted you?.. It even gives you a nifty little link to give some detail: http://datatables.net/tn/4

  • qforguesqforgues Posts: 4Questions: 1Answers: 0

    I don't know how to answer your question on relevant code. I am pulling from jquery.dataTables.js. Is this relevant?

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    is that the relevant portion of code related to the table thats having the issue you're running into?

    And are you the developer? jw..

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    You're also using TableTools, which is deprecated btw, id recommend switching to any of the new extensions that accomplish the same thing TableTools did (only better, and more features)

  • qforguesqforgues Posts: 4Questions: 1Answers: 0

    I am 'a' developer, but not javascript and this portion of it came with my template. Can you make specific suggestions of these extensions you mention.

  • allanallan Posts: 63,755Questions: 1Answers: 10,509 Site admin
    Answer ✓

    columnDefs: [ { orderable: false, targets: [ 4 ] } ],

    The targets: [ 4 ] is the issue. There is no column index 4 in your table - in fact you only have three columns. So what DataTables is doing is - it has been told information about column index 4 (i.e. column 5, since it counts from zero!) so it adds it! Then it finds that there is no information about that column in the HTML and thus the error.

    The fix is to change the target to match the column that you want. I presume in this case it is the right most column so you could simply use targets: -1.

    Allan

  • qforguesqforgues Posts: 4Questions: 1Answers: 0

    Thank you so much! That worked... @jLinux, still interested in alternatives that aren't deprecated, please advise...

    @allan, thank you so much. I didn't find that code where I was, but looking at a separate .js page I did find that exact code, updated as you requested and now there is no warning.. yay! Thanks again everyone!!

This discussion has been closed.