sDom string replacement error

sDom string replacement error

brennanbrennan Posts: 1Questions: 0Answers: 0
edited March 2010 in Bug reports
Assuming you are looking at jquery.dataTables.js (not the min version) line 1037 begins the description of the sDom varriable. It describes that 'H' and 'F' are used to insert jQueryUI themes.

Line 2839 is where the actual code is executed to perform the string replacement
[code]2839 var sDom = oSettings.sDom.replace( "H", "fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix" );
2840 sDom = sDom.replace( "F", "fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix" );[/code]

This is all fine and dandy except when you add a div in sDom with a class name that has a capital H or F in it such as...
[code]
$(document).ready(function() {
var oTable = $('#myTable').dataTable({
"sDom": '<"myHeader">t<"myFooter">'
});
}
[/code]

What happens is the string replacement will produce
[code]



[/code]

When what we really want it to do is
[code]



[/code]

The string replacement line needs to be more intelligent an not do a replacement on characters that are inside quotes.

Replies

  • allanallan Posts: 57,300Questions: 1Answers: 9,127 Site admin
    Good point! Thank you for pointing that out. I'll put a fix for this into the next version :-)

    Regards,
    Allan
This discussion has been closed.