nThs is null Strange

nThs is null Strange

pmsfopmsfo Posts: 5Questions: 0Answers: 0
edited July 2010 in General
Hi to All, I am having i big problem with DataTables and Codeigniter Framework, i search ins forums and still did'nt figured out.

The Problem is,

I am developing in my localhost machine with zendserver, codeigniter framework, php 5.3. my view file looks like this :

[code]
$(document).ready(function() {

oTable = $('#gridDashboard').dataTable({
"bJQueryUI": false,
"oLanguage": {"sUrl": "css/jquery/tabletools-pt.txt"},
"bLengthChange": false,
"bFilter": false,
"bInfo": true,
"bAutoWidth": true,
"bProcessing": false,
"bPaginate": true,
"sPaginationType": "full_numbers",
"sDom": '<"top">rt<"bottom"iflp<"clear">>'
});

$( oTable.fnGetNodes() ).click( function() {
var iPos = oTable.fnGetPosition( this );
var aData = oTable.fnGetData( iPos );
$("#txtNproj").val(aData[0]);
$("#txtNproj").attr("disabled", true);
$("#txtReferencia").val(aData[1]);
$("#txtReferencia").attr("disabled", true);
} );
} );

div class="container">
<? // Fun

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Can you give us a link to your production server so we can see what is happening? The nThs is null error normally occurs if you have an incorrect number of rows / cells in the body and the header. If you view source, what is the first TR of both the header and the body of the table?

    Allan
  • pmsfopmsfo Posts: 5Questions: 0Answers: 0
    Hi Allan, i am not if can put the aplication outside from our intranet so that you can see using firebug, i will see and will inform you soon about that.

    But i will explain how the grid is generated.

    In the html file using firebug the grid is generate like this

    [code]





    Nº Proj.
    Referencia
    Medida / Acção
    Estado
    Data
    Acção



    85
    020000000085
    Estratégias Locais de Desenvolvimento (B)
    PA Substituído
    2008-07-10



    94020000000094Estratégias Locais de Desenvolvimento (B)PA Substituído2008-07-11

    150020000000150Estratégias Locais de Desenvolvimento (B)PA Substituído2008-07-16


    [/code]


    Best Regards Pedro Oliveira
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    You've not got a THEAD element in that structure - which I think is the problem. DataTables needs the header to be in a THEAD: http://datatables.net/usage/#prerequisites

    Regards,
    Allan
  • pmsfopmsfo Posts: 5Questions: 0Answers: 0
    Hi Allan Hi figured out, But the problem still persistes but its not datatables problem.

    The thing is in my localhost machine the html table is generated like this


    [code]

    <!-- Heading -->


    Nº Proj.ReferenciaMedida / AcçãoEstadoDataAcção



    [/code]

    but on my produtcion server the header is generate like this .

    [code]


    Nº Proj.
    Referencia
    Medida / Acção
    Estado
    Data
    Acção



    [/code]

    This is so weird because i didn't change anything .

    I will see on codeigniter forums.

    Thanks allan you help was very well appreciated.

    Thank you Very much
  • pmsfopmsfo Posts: 5Questions: 0Answers: 0
    Hi to All I figured it out, but its very strange, to make the table with tbody, and thead, i use the my_table Library extension from codeigniter wiki.

    In the Developer the library works fine and generates the html table all 100% correct with the thead, tbody.

    But when i pass to the production server it stop's working, the html table is not very well generate, it's strange.

    So to solve my proble what i did was on the html Library from codeigniter and not the My_table exetension i added the folowing to the template:

    [code]
    'heading_row_start' => '',
    'heading_row_end' => '',

    [/code]
This discussion has been closed.