What's DataTables comma doesn't work in Linux/Suse?
What's DataTables comma doesn't work in Linux/Suse?
Working with the arrangement of numbers in the Brazilian way. (0.000,00) where the point is always before the comma.
My plugin does this replace "," by "." but does not work on Linux / Suse which is where my site is hosted. This was one posted here by the group plugin. Is there any reason for this?
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
"numeric-comma-pre": function ( a ) {
var x = (a == "-" || a.contains("img")) ? 0 : a.replace( /./g, "" ).replace( /,/, "." );
return parseFloat( x );
},
"numeric-comma-asc": function ( a, b ) {
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
},
"numeric-comma-desc": function ( a, b ) {
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
}
});
Thank you!
Answers
I don't understand what Linux / Suse has to do with Javascript not working?
Can you link to a test case showing the problem please - as required in the forum rules.
Allan
I can not send a test because the server does not accept external requests
I also do not understand what Linux does for Javascript does not work, but when the client accesses the page using a Linux system, the ordering does not work! Just using a Windows!
I'll do some ScreenShots of pages in both systems.
Any script errors reported in the console?
Allan
Allan,
I managed to reproduce the same example of the error and post on my server!
Just enter this address: http://datatable.webcindario.com/
What you should do is enter that address in Windows and in any other Linux, Unix, etc. click on the thead of the table and check that it does not order .. Here we use the distribution Debian 7.4 and does not work, but in Windows is correct
No javascript error appears on the console on both operating systems.
Problem solved!
There was a change in the code of the comma and I did not know.
The line has been added: | | a.contains ("img")) within the script. Therefore, contains is not a JS function and therefore was causing the error!
I'll redo this function correctly.
Thank you for your attention
I'm at a loss to explain that at the moment. I don't have a Debian machine I can try it on.
Allan