DataTables warning: table id=dataTable - Requested unknown parameter

DataTables warning: table id=dataTable - Requested unknown parameter

jotasenajotasena Posts: 11Questions: 2Answers: 0

After I added this snippet of code to my report everyone else started giving this problem.

When it started to have this problem, I automatically left the column invisible but it still gives me a problem:

{ "visible": false, "targets": vm.props.filter.ReportTypeFvsId == 1 ? [15] : null },

{
                                targets: [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
                                render: function (data, type, row, meta) {
                                    if (vm.props.filter.modelTypeId == 4 && vm.props.filter.tipoRelatorioAvaId == 3) {
                                        if (meta.col == 9) {
                                            return data;
                                        }
                                        else if (meta.col == 16) {
                                            return data;
                                        }
                                        var fichas = '';
                                        switch (meta.col) {
                                            case 3: fichas = row.JANID
                                                break;
                                            case 4: fichas = row.FEVID
                                                break;
                                            case 5: fichas = row.MARID
                                                break;
                                            case 6: fichas = row.ABRID
                                                break;
                                            case 7: fichas = row.MAIID
                                                break;
                                            case 8: fichas = row.JUNID
                                                break;
                                            case 10: fichas = row.JULID
                                                break;
                                            case 11: fichas = row.AGOID
                                                break;
                                            case 12: fichas = row.SETID
                                                break;
                                            case 13: fichas = row.OUTID
                                                break;
                                            case 14: fichas = row.NOVID
                                                break;
                                            case 15: fichas = row.DEZID
                                                break;
                                        }
                                    }
                                    else if (vm.props.filter.modelTypeId == 4 && vm.props.filter.tipoRelatorioAvaId == 4) {
                                        var fichas = '';
                                        if (meta.col == 6) {
                                            return data;
                                        }
                                        else if (meta.col == 10) {
                                            return data;
                                        }
                                        else if (meta.col == 14) {
                                            return data;
                                        }
                                        else if (meta.col == 18) {
                                            return data;
                                        }
                                        switch (meta.col) {
                                            case 3: fichas = row.JANID
                                                break;
                                            case 4: fichas = row.FEVID
                                                break;
                                            case 5: fichas = row.MARID
                                                break;
                                            case 7: fichas = row.ABRID
                                                break;
                                            case 8: fichas = row.MAIID
                                                break;
                                            case 9: fichas = row.JUNID
                                                break;
                                            case 11: fichas = row.JULID
                                                break;
                                            case 12: fichas = row.AGOID
                                                break;
                                            case 13: fichas = row.SETID
                                                break;
                                            case 15: fichas = row.OUTID
                                                break;
                                            case 16: fichas = row.NOVID
                                                break;
                                            case 17: fichas = row.DEZID
                                                break;
                                        }
                                    }
                                    if (vm.props.filter.modelTypeId == 4) {
                                    var mediaS1 = row.PrimeiraMediaSemestral;
                                    var mediaS2 = row.SegundaMediaSemestral;

                                    var mediaT1 = row.PrimeiraMediaTrimestral;
                                    var mediaT2 = row.SegundaMediaTrimestral;
                                    var mediaT3 = row.TerceiraMediaTrimestral;
                                    var mediaT4 = row.QuartaMediaTrimestral;
                                    }
                                    if (vm.props.filter.modelTypeId == 4 && vm.props.filter.tipoRelatorioAvaId == 3) {
                                        if (mediaS1 != undefined && parseFloat(data.replace(",", ".")) < parseFloat(mediaS1.replace(",", "."))) {
                                            data = '<a onclick="abrirModal([' + fichas.toString() + '])" data-toggle="tooltip" data-placement="top" style="color:#f00"; title="Abrir Avaliação">' + data + '</a>';
                                        }
                                        else if (mediaS2 != undefined && parseFloat(data.replace(",", ".")) < parseFloat(mediaS2.replace(",", "."))) {
                                            data = '<a onclick="abrirModal([' + fichas.toString() + '])" data-toggle="tooltip" data-placement="top"  title="Abrir Avaliação">' + data + '</a>';
                                        }
                                    }
                                    else if (vm.props.filter.modelTypeId == 4 && vm.props.filter.tipoRelatorioAvaId == 4) {
                                        if (mediaT1 != undefined && parseFloat(data.replace(",", ".")) < parseFloat(mediaT1.replace(",", "."))) {
                                            data = '<a onclick="abrirModal([' + fichas.toString() + '])" data-toggle="tooltip" data-placement="top" style="color:#f00"; title="Abrir Avaliação">' + data + '</a>';
                                        }
                                        else if (mediaT2 != undefined && parseFloat(data.replace(",", ".")) < parseFloat(mediaT2.replace(",", "."))) {
                                            data = '<a onclick="abrirModal([' + fichas.toString() + '])" data-toggle="tooltip" data-placement="top" style="color:#f00"; title="Abrir Avaliação">' + data + '</a>';
                                        }
                                        else if (mediaT3 != undefined && parseFloat(data.replace(",", ".")) < parseFloat(mediaT3.replace(",", "."))) {
                                            data = '<a onclick="abrirModal([' + fichas.toString() + '])" data-toggle="tooltip" data-placement="top" style="color:#f00"; title="Abrir Avaliação">' + data + '</a>';
                                        }
                                        else if (mediaT4 != undefined && parseFloat(data.replace(",", ".")) < parseFloat(mediaT4.replace(",", "."))) {
                                            data = '<a onclick="abrirModal([' + fichas.toString() + '])" data-toggle="tooltip" data-placement="top"  title="Abrir Avaliação">' + data + '</a>';
                                        }
                                    }
                                    return data;
                                }
                            }

Answers

  • kthorngrenkthorngren Posts: 13,625Questions: 25Answers: 3,207
    edited July 1

    Do you have data for tis column or is it just rendering data. You may nee to use columns.defaultContent or data set to null or both if its only a rendered column. Hidding the column won't make a difference.

    Kevin

  • jotasenajotasena Posts: 11Questions: 2Answers: 0

    This column not have a value is null.

  • jotasenajotasena Posts: 11Questions: 2Answers: 0
    edited July 1

    How i apply this ? columns.defaultCotent How i use ?

  • kthorngrenkthorngren Posts: 13,625Questions: 25Answers: 3,207

    The second example in the columns.defaultContent docs is how to use it if you want to display a blank value.

    Kevin

  • jotasenajotasena Posts: 11Questions: 2Answers: 0

    In this case I don't have to show the data nor the column understood? This column is already empty by default, but I can't show it there.

  • kthorngrenkthorngren Posts: 13,625Questions: 25Answers: 3,207

    Sorry, I'm not following what you are trying to do. Can you post a link to your page or a test case replicating the issue so we can take a look?
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

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

    If you don't have data for a particular column you either need to not define it or use columns.defaultContent to place something in the column if it doesn't exist, like this example:
    http://live.datatables.net/vofapefu/1/edit

    Uncomment //defaultContent: '' to see the error is removed. If you need more specific help then please updated the test case or provide your own so we can see what you are trying to do.

    Kevin

  • jotasenajotasena Posts: 11Questions: 2Answers: 0
    edited July 1

    I'm using how you told, but not work.

  • jotasenajotasena Posts: 11Questions: 2Answers: 0

    @kthorngren Thanks man!

    SOLVED!!!!

Sign In or Register to comment.