prevent emty class attribute added to each cell ( class=" " )
prevent emty class attribute added to each cell ( class=" " )
hirnsaege
Posts: 5Questions: 0Answers: 0
Dear supporters,
i'm trying to clean up a large data table as much as possible to improve loading and processing performance.
besides the usual optimizations, i also try to clean up the source DOM as much as possible, that is removing unneeded classes etc.
after i have removed almost all classes, i see that datatables adds an emty class attribute to each cell.
So my original DOM is: foo
and datatables processes and creates: foo
I'm wondering if this is any purpose, and if not, if i could prevent doing it, as i think adding lets say 1000x20 attributes to the DOM may take some time in slower browsers ...
I have searched the documentation, but could not find anything about cell classes, only about row classes so far.
thanks for your help
hirnsaege
i'm trying to clean up a large data table as much as possible to improve loading and processing performance.
besides the usual optimizations, i also try to clean up the source DOM as much as possible, that is removing unneeded classes etc.
after i have removed almost all classes, i see that datatables adds an emty class attribute to each cell.
So my original DOM is: foo
and datatables processes and creates: foo
I'm wondering if this is any purpose, and if not, if i could prevent doing it, as i think adding lets say 1000x20 attributes to the DOM may take some time in slower browsers ...
I have searched the documentation, but could not find anything about cell classes, only about row classes so far.
thanks for your help
hirnsaege
This discussion has been closed.
Replies
Allan
i was just wondering whether adding the (from my perspective useless) empty class while initializing would cause a delay before the table is "usable", but if it has a purpose, it's okay to me.
just thinking: would it potentially speed up things if i add the class=" " when creating the table at the server, so datatables does not have to do that job?
Allan
this is my configuration at the moment:
[code]
var oTablename = $('#tablename').dataTable( {
"bPaginate": false,
"bLengthChange": false,
"bStateSave": true,
"iCookieDuration": 120,
"bProcessing": true,
"bSortClasses": false,
"bAutoWidth": false,
"aoColumns": [
{"sWidth": "25%", "bSearchable": false, "bSortable": true},
{"sWidth": "25%", "bSearchable": false, "bSortable": false},
{"sWidth": "25%", "bSearchable": true, "bSortable": true},
{"sWidth": "25%", "bSearchable": false, "bSortable": false},
],
"asStripeClasses": [ ]
}
} );
[/code]
i have set bSortClasses to false. this way, every td in the table has a class=" " added with initialisation.
If i set it to true, it every tdhas the class=" " after initialization, and then adds the classes class="sorting_1 " ... to the column cells when they are sorted (as you say), while the rest of the columns (not specifically sorted) is still class=" ".
sorry if leading you in circles with this ... i'm even not sure if it's a problem at all.
kind regards
hirnsaege
Thanks for flagging this up.
Allan
Allan
Is there any fix yet?
Thanks in advance.
Allan