mRender - warning: DataTables warning (table id = 'Clientes'): Requested unknown parameter 'Bac'

mRender - warning: DataTables warning (table id = 'Clientes'): Requested unknown parameter 'Bac'

NogasNogas Posts: 2Questions: 0Answers: 0
edited December 2013 in DataTables 1.9
This page runs in my intranet, so I can not post a direct link.

Here is the HTML:
[code]



Id
Apelido
Telefone
SMS
Bac
Jun
Por
F10
Painel
Extra





[/code]

And here is the JS:
[code]
$('#Clientes').dataTable({
"bPaginate": false,
"bProcessing": true,
"sAjaxSource": 'Ajax.php?O=CadCli',
"bLengthChange": true,
"bAutoWidth" : false,
"aoColumnDefs": [
{"aTargets": [0],
"mData": "Id",
"sWidth ": "40px",
"sClass": "Centralizado"},
{"aTargets": [1],
"mData": "Cli"},
{"aTargets": [2],
"mData": "Tel",
"sWidth ": "50px",
"sClass": "Centralizado",
"bSortable": false},
{"aTargets": [3],
"mData": "Sms",
"sWidth ": "50px",
"sClass": "Centralizado",
"bSortable": false},
{"aTargets": [4],
"mData": "Bac",
"sWidth ": "50px",
"sClass": "Centralizado",
"bSortable": false,
"mRender": function(data, type, row){
//console.log(data, ' - ', type, ' - ', row);
if (data == "S") {
return '';
}
}},
{"aTargets": [5],
"mData": "Jun",
"sWidth ": "40px",
"sClass": "Centralizado",
"bSortable": false},
{"aTargets": [6],
"mData": "Por",
"sWidth ": "50px",
"sClass": "Centralizado",
"bSortable": false},
{"aTargets": [7],
"mData": "VerF10"},
{"aTargets": [8],
"mData": "VerPai"},
{"aTargets": [9],
"bVisible": false,
"mData": "Sta"}
],
"oLanguage": {
"sProcessing": "Processando...",
"sLengthMenu": "Mostrar _MENU_ registros",
"sZeroRecords": "Não foram encontrados resultados",
"sInfo": "Mostrando de _START_ até _END_ de _TOTAL_ registros",
"sInfoEmpty": "Mostrando de 0 até 0 de 0 registros",
"sInfoFiltered": "(filtrado de _MAX_ registros no total)",
"sInfoPostFix": "",
"sSearch": "Buscar:",
"sUrl": "",
"oPaginate": {
"sFirst": "Primeiro",
"sPrevious": "Anterior",
"sNext": "Seguinte",
"sLast": "Último"
}
}
});
[/code]

And the debug URL:

http://debug.datatables.net/opimiz

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited January 2014
    [code]
    if (data == "S") {
    return '';
    }
    [/code]

    there is no else. So if `Bac` is not `S` then you are returning undefined, and hence the issue. You could return `''` or anything else, but you need to return something other than null or undefined.

    Allan
  • NogasNogas Posts: 2Questions: 0Answers: 0
    Yep.
    That did the trick.
    Thank you very much.

    P.S.: was this information somewhere? I mean I did not find this info in the reference documentation. Should I have had?
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    In the mData documentation it says:

    > The return value from the function is not required when 'set' is the type of call, but otherwise the return is what will be used for the data requested.

    So yes it is there, but it requires close reading... I'm not sure it is possible to highlight that any more as its nitty-gritty. if I highlight that,t hen there are thousands of other small things which should also be highlighted!

    Allan
This discussion has been closed.