sDom string replacement error
sDom string replacement error
brennan
Posts: 1Questions: 0Answers: 0
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.
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.
This discussion has been closed.
Replies
Regards,
Allan