diff --git a/web/jQuery/CXM_jquery_datatable.anubis b/web/jQuery/CXM_jquery_datatable.anubis index c69ce74..6c717bf 100644 --- a/web/jQuery/CXM_jquery_datatable.anubis +++ b/web/jQuery/CXM_jquery_datatable.anubis @@ -73,7 +73,8 @@ public define HTML_Partial_Content Bool enable_change_page_length, // if true, "enable_pagination" must be true too. Bool enable_search_field, Bool enable_columns_sorting, - String lang + String lang, + JQuery_datatable_extra_type extra ) = partial_content( @@ -98,8 +99,9 @@ public define HTML_Partial_Content "\"bStateSave\": true, \"bLengthChange\":"+to_String(enable_change_page_length)+", \"bSort\":"+to_String(enable_columns_sorting)+","+ - get_datatable_translation(lang)+" - }); + get_datatable_translation(lang)+ + jquery_datatable_extra_to_string(extra)+ + "}); }); " ) @@ -122,4 +124,4 @@ public define HTML_Partial_Content Bool enable_search_field, Bool enable_columns_sorting ) = - jquery_datatable(table_id, table, enable_jqueryui, enable_pagination, pagination_type, scrollY, enable_change_page_length, enable_search_field, enable_columns_sorting, "en"). + 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). diff --git a/web/jQuery/CXM_jquery_datatable_server_side.anubis b/web/jQuery/CXM_jquery_datatable_server_side.anubis new file mode 100644 index 0000000..5738c39 --- /dev/null +++ b/web/jQuery/CXM_jquery_datatable_server_side.anubis @@ -0,0 +1,29 @@ +/* + * Created by PyramIDE. + * User: Totoro + * Date: 03/05/2014 + * Time: 17:46 + * + */ + +read calexium_lib/web/jQuery/CXM_jquery_datatable_types.anubis +read tools/basis.anubis +read calexium_lib/web/CXM_common.anubis +read calexium_lib/web/CXM_web_arg_utils.anubis + +public define Maybe(JQuery_datatable_server_side_type) + get_datatable_server_side_query + ( + List(Web_arg) lwa + )= + + if get_String(lwa, "sEcho") is {failure then failure, success(secho) then + if get_Int(lwa, "iColumns") is {failure then failure, success(icolumns) then + if get_String(lwa, "sColumns") is {failure then failure, success(scolumns) then + if get_Int(lwa, "iDisplayStart") is {failure then failure, success(idisplaystart) then + if get_Int(lwa, "iDisplayLength") is {failure then failure, success(idisplaylength) then + if get_String(lwa, "sSearch") is {failure then failure, success(sSearch) then +// if get_String(lwa, "sSortDir") is {failure then failure, success(sSortDir) then + success(dt_ss(secho, icolumns, scolumns, idisplaystart, idisplaylength, sSearch)) + }}}}}}. + diff --git a/web/jQuery/CXM_jquery_datatable_types.anubis b/web/jQuery/CXM_jquery_datatable_types.anubis index 9bc813d..f6c3765 100644 --- a/web/jQuery/CXM_jquery_datatable_types.anubis +++ b/web/jQuery/CXM_jquery_datatable_types.anubis @@ -11,6 +11,7 @@ read calexium_lib/web/CXM_making_a_web_site.anubis read tools/basis.anubis read system/string.anubis + public type JQuery_datatable_pagination_type: jq_dt_pt_two_button, //default option jq_dt_pt_full_numbers @@ -19,6 +20,21 @@ public type JQuery_datatable_scrollY_type: no_scroll, scrollY(Int size). +public type JQuery_datatable_extra_type: + no_extra, + extra(String extra). + +public define String + jquery_datatable_extra_to_string + ( + JQuery_datatable_extra_type ex + )= + if ex is + { + no_extra then "", + extra(_ex) then ",\n"+_ex + }. + public define String jquery_datatable_pagination_type_to_string ( @@ -43,3 +59,13 @@ public define JQuery_datatable_pagination_type if st="full_numbers" then jq_dt_pt_full_numbers else jq_dt_pt_two_button . + +public type JQuery_datatable_server_side_type: + dt_ss( String sEcho, + Int iColumns, + String sColumns, + Int iDisplayStart, + Int iDisplayLength, + String sSearch + ). + -- libgit2 0.21.4