Commit 2ecb5f1629e32d0b431f710dc88833f2c5ef4cdd
1 parent
6f6bfbd7
update datatable to use 1.10.x features instead of the legacy features (note: st…
…ill force legacy Ajax)
Showing
1 changed file
with
18 additions
and
13 deletions
Show diff stats
web/jQuery/CXM_jquery_datatable.anubis
| @@ -46,11 +46,15 @@ public define List(HTML_Head_Tag) | @@ -46,11 +46,15 @@ public define List(HTML_Head_Tag) | ||
| 46 | [ | 46 | [ |
| 47 | //css(css_file("jquery/plug-in/DataTables-1.10.7/media/css/jquery.dataTables.min.css")), | 47 | //css(css_file("jquery/plug-in/DataTables-1.10.7/media/css/jquery.dataTables.min.css")), |
| 48 | //css(css_file("jquery/plug-in/DataTables-1.10.7/media/css/jquery.dataTables_themeroller.css")), | 48 | //css(css_file("jquery/plug-in/DataTables-1.10.7/media/css/jquery.dataTables_themeroller.css")), |
| 49 | - js(js_file("js/jquery/plug-in/DataTables-1.10.7/media/js/jquery.dataTables.min.js")), | ||
| 50 | - js(js_file("js/jquery/plug-in/DataTables-1.10.7/media/js/dataTables.jqueryui.js")) , //only for datatable 1.10 | ||
| 51 | - css(css_file("js/jquery/plug-in/DataTables-1.10.7/media/css/dataTables.jqueryui.css")), //only for datatable 1.10 | ||
| 52 | - css(css_file("js/jquery/plug-in/DataTables-1.10.7/extensions/Scroller/css/dataTables.scroller.min.css")), | ||
| 53 | - js(js_file("js/jquery/plug-in/DataTables-1.10.7/extensions/Scroller/js/dataTables.scroller.js")), | 49 | + |
| 50 | + js(js_file("js/jquery/plug-in/datatables.min.js")), | ||
| 51 | + css(css_file("css/jquery/datatables.min.css")), | ||
| 52 | + //js(js_file("js/jquery/plug-in/DataTables-1.10.7/media/js/jquery.dataTables.min.js")), | ||
| 53 | + //js(js_file("js/jquery/plug-in/DataTables-1.10.7/media/js/dataTables.jqueryui.js")) , //only for datatable 1.10 | ||
| 54 | + //css(css_file("js/jquery/plug-in/DataTables-1.10.7/media/css/dataTables.jqueryui.css")), //only for datatable 1.10 | ||
| 55 | + //css(css_file("js/jquery/plug-in/DataTables-1.10.7/extensions/Scroller/css/dataTables.scroller.min.css")), | ||
| 56 | + //js(js_file("js/jquery/plug-in/DataTables-1.10.7/extensions/Scroller/js/dataTables.scroller.js")), | ||
| 57 | + | ||
| 54 | // css(css_file("jquery/plug-in/DataTables-1.10.7/extensions/Responsive/css/dataTables.responsive.css")), | 58 | // css(css_file("jquery/plug-in/DataTables-1.10.7/extensions/Responsive/css/dataTables.responsive.css")), |
| 55 | // js(js_file("jquery/plug-in/DataTables-1.10.7/extensions/responsive/js/dataTables.responsive.js")), | 59 | // js(js_file("jquery/plug-in/DataTables-1.10.7/extensions/responsive/js/dataTables.responsive.js")), |
| 56 | ] | 60 | ] |
| @@ -78,7 +82,7 @@ public define HTML_Partial_Content | @@ -78,7 +82,7 @@ public define HTML_Partial_Content | ||
| 78 | = | 82 | = |
| 79 | if enable_jqueryui then | 83 | if enable_jqueryui then |
| 80 | partial_content( jquery_datatables_1_10_init + | 84 | partial_content( jquery_datatables_1_10_init + |
| 81 | - [ js_inline(jquery_ready("$('#"+table_id+"').dataTable({\"bJQueryUI\":true});")) ], | 85 | + [ js_inline(jquery_ready("$('#"+table_id+"').dataTable({\"jQueryUI\":true});")) ], |
| 82 | table | 86 | table |
| 83 | ) | 87 | ) |
| 84 | else | 88 | else |
| @@ -106,22 +110,23 @@ public define HTML_Partial_Content | @@ -106,22 +110,23 @@ public define HTML_Partial_Content | ||
| 106 | partial_content( jquery_datatables_1_10_init + | 110 | partial_content( jquery_datatables_1_10_init + |
| 107 | [ | 111 | [ |
| 108 | js_inline(jquery_ready(" | 112 | js_inline(jquery_ready(" |
| 113 | + $.fn.dataTable.ext.legacy.ajax = true; | ||
| 109 | $('#"+table_id+"').dataTable( | 114 | $('#"+table_id+"').dataTable( |
| 110 | { | 115 | { |
| 111 | \"jQueryUI\":"+to_String(enable_jqueryui)+", | 116 | \"jQueryUI\":"+to_String(enable_jqueryui)+", |
| 112 | - \"sPaginationType\":'"+jquery_datatable_pagination_type_to_string(pagination_type)+"', | ||
| 113 | - \"bFilter\":"+to_String(enable_search_field)+", | ||
| 114 | - \"bPaginate\":"+to_String(enable_pagination)+","+ | 117 | + \"pagingType\":'"+jquery_datatable_pagination_type_to_string(pagination_type)+"', |
| 118 | + \"searching\":"+to_String(enable_search_field)+", | ||
| 119 | + \"paging\":"+to_String(enable_pagination)+","+ | ||
| 115 | // responsive: true,"+ | 120 | // responsive: true,"+ |
| 116 | 121 | ||
| 117 | if scrollY is | 122 | if scrollY is |
| 118 | { | 123 | { |
| 119 | no_scroll then "", | 124 | no_scroll then "", |
| 120 | - scrollY(size) then "\"sScrollY\": \""+size+"px\"," | 125 | + scrollY(size) then "\"scrollY\": \""+size+"px\"," |
| 121 | }+ | 126 | }+ |
| 122 | - "\"bStateSave\": true, | ||
| 123 | - \"bLengthChange\":"+to_String(enable_change_page_length)+", | ||
| 124 | - \"bSort\":"+to_String(enable_columns_sorting)+","+ | 127 | + "\"stateSave\": true, |
| 128 | + \"lengthChange\":"+to_String(enable_change_page_length)+", | ||
| 129 | + \"ordering\":"+to_String(enable_columns_sorting)+","+ | ||
| 125 | get_datatable_translation(lang, web_dir)+ | 130 | get_datatable_translation(lang, web_dir)+ |
| 126 | jquery_datatable_extra_to_string(extra)+ | 131 | jquery_datatable_extra_to_string(extra)+ |
| 127 | "}); | 132 | "}); |