/* * Created by PyramIDE. * User: Jeremy * Date: 12/09/2012 * Time: 16:14 * * */ read calexium_lib/web/CXM_making_a_web_site.anubis read calexium_lib/web/CXM_jquery.anubis read calexium_lib/web/jQuery/CXM_jquery_datatable_types.anubis read calexium_lib/web/jQuery/CXM_jquery_datatable_translation.anubis read tools/basis.anubis read system/string.anubis read system/convert.anubis transmit calexium_lib/web/jQuery/CXM_jquery_datatable_plugins.anubis /* Initialize jQuery datatables */ public define List(HTML_Head_Tag) jquery_datatables_1_9_init ( String web_dir, ) = [ css(css_file("css/jquery/jquery.dataTables.css")), css(css_file("/css/jquery/jquery.dataTables_themeroller.css")), js(js_file("/js/jquery/jquery.dataTables.js")), //js(js_file("js/jquery/dataTables/dataTables.jqueryui.js")) , only for datatable 1.10 //css(css_file("js/jquery/dataTables/extensions/Scroller/css/shCore.css")), //css(css_file("js/jquery/dataTables/extensions/Scroller/css/shThemeDataTables.css")), //css(css_file("js/jquery/dataTables/extensions/Scroller/css/doc.css")), css(css_file("js/jquery/dataTables/extensions/Scroller/css/dataTables.scroller.css")), js(js_file("js/jquery/dataTables/extensions/Scroller/js/dataTables.scroller.js")), ] . public define List(HTML_Head_Tag) jquery_datatables_1_10_init // ( // String web_dir, // ) = [ //css(css_file("jquery/plug-in/DataTables-1.10.7/media/css/jquery.dataTables.min.css")), //css(css_file("jquery/plug-in/DataTables-1.10.7/media/css/jquery.dataTables_themeroller.css")), js(js_file("js/jquery/plug-in/DataTables-1.10.7/media/js/jquery.dataTables.js")), js(js_file("js/jquery/plug-in/DataTables-1.10.7/media/js/dataTables.jqueryui.js")) , //only for datatable 1.10 css(css_file("js/jquery/plug-in/DataTables-1.10.7/media/css/dataTables.jqueryui.css")), //only for datatable 1.10 css(css_file("js/jquery/plug-in/DataTables-1.10.7/extensions/Scroller/css/dataTables.scroller.min.css")), js(js_file("js/jquery/plug-in/DataTables-1.10.7/extensions/Scroller/js/dataTables.scroller.js")), // css(css_file("jquery/plug-in/DataTables-1.10.7/extensions/Responsive/css/dataTables.responsive.css")), // js(js_file("jquery/plug-in/DataTables-1.10.7/extensions/responsive/js/dataTables.responsive.js")), ] . public define HTML_Partial_Content jquery_datatable ( String table_id, HTML_Off_Form table ) = partial_content(jquery_datatables_1_10_init + [ js_inline(jquery_ready("$('#"+table_id+"').dataTable();")) ], table ) . public define HTML_Partial_Content jquery_datatable ( String table_id, HTML_Off_Form table, Bool enable_jqueryui, ) = if enable_jqueryui then partial_content( jquery_datatables_1_10_init + [ js_inline(jquery_ready("$('#"+table_id+"').dataTable({\"bJQueryUI\":true});")) ], table ) else jquery_datatable(table_id, table) . public define HTML_Partial_Content jquery_datatable ( String table_id, HTML_Partial_Content table, Bool enable_jqueryui, Bool enable_pagination, JQuery_datatable_pagination_type pagination_type, JQuery_datatable_scrollY_type scrollY, Bool enable_change_page_length, // if true, "enable_pagination" must be true too. Bool enable_search_field, Bool enable_columns_sorting, String lang, JQuery_datatable_extra_type extra, String web_dir ) = partial_content( jquery_datatables_1_10_init + [ js_inline(jquery_ready(" $('#"+table_id+"').dataTable( { \"jQueryUI\":"+to_String(enable_jqueryui)+", \"sPaginationType\":'"+jquery_datatable_pagination_type_to_string(pagination_type)+"', \"bFilter\":"+to_String(enable_search_field)+", \"bPaginate\":"+to_String(enable_pagination)+","+ // responsive: true,"+ if scrollY is { no_scroll then "", scrollY(size) then "\"sScrollY\": \""+size+"px\"," }+ "\"bStateSave\": true, \"bLengthChange\":"+to_String(enable_change_page_length)+", \"bSort\":"+to_String(enable_columns_sorting)+","+ get_datatable_translation(lang, web_dir)+ jquery_datatable_extra_to_string(extra)+ "}); " ) ) ], table ) . public define HTML_Partial_Content jquery_datatable ( String table_id, HTML_Off_Form table, Bool enable_jqueryui, Bool enable_pagination, JQuery_datatable_pagination_type pagination_type, JQuery_datatable_scrollY_type scrollY, Bool enable_change_page_length, // if true, "enable_pagination" must be true too. Bool enable_search_field, Bool enable_columns_sorting, String web_dir ) = jquery_datatable(table_id, partial_content(table), enable_jqueryui, enable_pagination, pagination_type, scrollY, enable_change_page_length, enable_search_field, enable_columns_sorting, "en", no_extra, web_dir). public define HTML_Partial_Content jquery_datatable ( String table_id, HTML_Partial_Content table, Bool enable_jqueryui, Bool enable_pagination, JQuery_datatable_pagination_type pagination_type, JQuery_datatable_scrollY_type scrollY, Bool enable_change_page_length, // if true, "enable_pagination" must be true too. Bool enable_search_field, Bool enable_columns_sorting, String web_dir ) = jquery_datatable(table_id, table, enable_jqueryui, enable_pagination, pagination_type, scrollY, enable_change_page_length, enable_search_field, enable_columns_sorting, "en", no_extra, web_dir).