Datatables - Rowspan in tbody: Can not read property 'className' of undefined

1

I'm using JQuery and the DataTable plugin in my tables. So in some situations I need to use rowspan in the body ( tbody ) of my tables, which generates the following error in Google Chrome and ends up not applying the plugin: Uncaught TypeError: Cannot read property 'className' of undefined

I read about the fakeRowspan plugin, however either it did not work or I could not use it properly.

See the fiddle below with the problem:

Fiddle

    
asked by anonymous 14.04.2014 / 20:20

2 answers

1

Boy, I took a look at this plugin jquery.datatable.js and it has approx 12,000 lines.

In order not to give the error, I added the test in the error line 669 :

if(nCell)
    nCell.className += ' '+oCol.sClass;

Then began to give an alert that I commented on the lines, 781 to 784:

/*
_fnLog( oSettings, 0, "Requested unknown parameter "+
(typeof oCol.mData=='function' ? '{mData function}' : "'"+oCol.mData+"'")+ 
" from the data source for row "+iRow );
oSettings.iDrawError = oSettings.iDraw;
*/

Follow the JSFIDDLE link: link

    
14.04.2014 / 20:41
0

I know that my answer will not solve your problem (and I researched a lot about it and the only reference I found the link for it did not exist anymore, as you can see in this link ) But here are a few pointers to your table so you can avoid future problems with your code: / p>

  • You have repeated ids in it, such as #tabelainfo and #corpotable;
  • The colspan and rowspan properties when values of 1 are not required;
  • The tag has been deprecated, CSS is recommended for this;
  • The "align" property in the td's is also not recommended for this use CSS;
  • There are missing rows in the table, in this mix of rows and columns some have been forgotten, to know where they are put a border="1" in the table and see the empty spaces, this is sure to avoid future problems in the dataTables () .

Remembering that above are just tips I noticed when seeking a resolution for your problem by looking at version 6 of your fiddle.

As I'm currently working with DataTables too and having some issues with it, I'll keep searching and if I can find a solution to this question I'll come back here again.

    
29.05.2014 / 15:16