diff options
| author | Greg Roach <fisharebest@gmail.com> | 2015-12-18 09:43:18 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2015-12-18 09:43:18 +0000 |
| commit | 07cae1156c3ade93a10becbc6a3bba7bcf932920 (patch) | |
| tree | 7b28bd524e06e10cb2cb3799bf4d76177d6533a2 | |
| parent | af5d9a801adf160537b257060c194a073886f688 (diff) | |
| parent | 118c7edbe3d6f83656cf0f90c45e8801fa069a61 (diff) | |
| download | webtrees-07cae1156c3ade93a10becbc6a3bba7bcf932920.tar.gz webtrees-07cae1156c3ade93a10becbc6a3bba7bcf932920.tar.bz2 webtrees-07cae1156c3ade93a10becbc6a3bba7bcf932920.zip | |
Merge pull request #785 from wooc/master
surnameTable function doesn't sort surnames correctly in Polish #783 93b25ed
| -rw-r--r-- | app/Functions/FunctionsPrintLists.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/Functions/FunctionsPrintLists.php b/app/Functions/FunctionsPrintLists.php index f9b43a08a8..5401e205db 100644 --- a/app/Functions/FunctionsPrintLists.php +++ b/app/Functions/FunctionsPrintLists.php @@ -1524,6 +1524,8 @@ class FunctionsPrintLists { $controller ->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL) ->addInlineJavascript(' + jQuery.fn.dataTableExt.oSort["unicode-asc" ]=function(a,b) {return a.replace(/<[^<]*>/, "").localeCompare(b.replace(/<[^<]*>/, ""))}; + jQuery.fn.dataTableExt.oSort["unicode-desc"]=function(a,b) {return b.replace(/<[^<]*>/, "").localeCompare(a.replace(/<[^<]*>/, ""))}; jQuery.fn.dataTableExt.oSort["num-asc" ]=function(a,b) {a=parseFloat(a); b=parseFloat(b); return (a<b) ? -1 : (a>b ? 1 : 0);}; jQuery.fn.dataTableExt.oSort["num-desc"]=function(a,b) {a=parseFloat(a); b=parseFloat(b); return (a>b) ? -1 : (a<b ? 1 : 0);}; jQuery(".surname-list").dataTable( { @@ -1531,10 +1533,10 @@ class FunctionsPrintLists { jQueryUI: true, autoWidth: false, paging: false, - sorting: [], + sorting: [[1, "asc"]], columns: [ /* 0 name */ { dataSort: 1 }, - /* 1 NAME */ { visible: false }, + /* 1 NAME */ { type: "unicode", visible: false }, /* 2 count */ { dataSort: 3, class: "center" }, /* 3 COUNT */ { visible: false } ], |
