Commit c0c76e0fb9e167e1b6a0e7666f5d74db9ea3bdb2
Merge branch 'release/ANUBIS_1_14' of ssh://gitlab.calexium.com:33022/calexium/c…
…alexium_lib into release/ANUBIS_1_14
Showing
6 changed files
with
57 additions
and
18 deletions
Show diff stats
database/db_types.anubis
| ... | ... | @@ -8,9 +8,14 @@ |
| 8 | 8 | transmit tools/basis.anubis |
| 9 | 9 | transmit tools/ISO-8601.anubis |
| 10 | 10 | |
| 11 | +/* DB_id will is deprecated. Please use next version below all upper case */ | |
| 11 | 12 | public type DB_id: |
| 12 | 13 | none, |
| 13 | 14 | db_id(Int value). |
| 15 | + | |
| 16 | +public type DB_ID: | |
| 17 | + none, | |
| 18 | + pk(Int value). | |
| 14 | 19 | |
| 15 | 20 | public type DB_datetime: |
| 16 | 21 | db_datetime(String datetime). //Date and time in ISO8601 format "YYYY-MM-DD hh:mm:ss" |
| ... | ... | @@ -35,7 +40,7 @@ public define String |
| 35 | 40 | none then "none", |
| 36 | 41 | db_id(_idx) then abs_to_decimal(_idx) |
| 37 | 42 | }. |
| 38 | - | |
| 43 | + | |
| 39 | 44 | public define Int |
| 40 | 45 | to_Int |
| 41 | 46 | ( |
| ... | ... | @@ -50,6 +55,30 @@ public define Int |
| 50 | 55 | public define String |
| 51 | 56 | to_String |
| 52 | 57 | ( |
| 58 | + DB_ID idx | |
| 59 | + )= | |
| 60 | + if idx is | |
| 61 | + { | |
| 62 | + none then "none", | |
| 63 | + pk(_idx) then abs_to_decimal(_idx) | |
| 64 | + }. | |
| 65 | + | |
| 66 | +public define Int | |
| 67 | + to_Int | |
| 68 | + ( | |
| 69 | + DB_ID idx | |
| 70 | + )= | |
| 71 | + if idx is | |
| 72 | + { | |
| 73 | + none then (Int)-1, | |
| 74 | + pk(_idx) then _idx | |
| 75 | + }. | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | +public define String | |
| 80 | + to_String | |
| 81 | + ( | |
| 53 | 82 | DB_date d |
| 54 | 83 | )= |
| 55 | 84 | date(d). | ... | ... |
database/vtm/view_table_renderer.anubis
| ... | ... | @@ -144,8 +144,9 @@ define HTML_Row(HTML_Off_Form) make_line |
| 144 | 144 | { |
| 145 | 145 | text(string) then cell((HTML_Off_Form)text(string)), |
| 146 | 146 | // link(id, string) then cell((HTML_Off_Form)actioner(same,same, link(string), action_name, [("table_name", table_name),("id",id)])), |
| 147 | - link(id, string) then cell((HTML_Off_Form)literal(jq_dialog_open(string, dialog_id(action_name+"_dlg_ajax"), "'id="+id+"'"))), | |
| 148 | - icon(icon_path) then cell((HTML_Off_Form)image([], icon_path, "")) | |
| 147 | + link(id, string) then cell((HTML_Off_Form)literal(jq_dialog_open(string, dialog_id(action_name+"_dlg_ajax"), "'id="+id+"'"))), | |
| 148 | + link_id_action(id, name, action) then cell((HTML_Off_Form)actioner(same,same, link(name), action, [("id",id)])), | |
| 149 | + icon(icon_path) then cell((HTML_Off_Form)image([], icon_path, "")) | |
| 149 | 150 | }, |
| 150 | 151 | make_line(table_name, action_name, t, [cell . so_far]) |
| 151 | 152 | }. |
| ... | ... | @@ -191,6 +192,7 @@ define HTML_Header_Row(HTML_Off_Form) |
| 191 | 192 | { |
| 192 | 193 | text(string) then header_cell((HTML_Off_Form)text(_T(string))), |
| 193 | 194 | link(id, string) then header_cell((HTML_Off_Form)actioner(same,same, link(string),"edit_table",[])), //TODO |
| 195 | + link_id_action(id, text, action) then header_cell((HTML_Off_Form)actioner(same,same, link(text),action,[("id",id)])), //TODO | |
| 194 | 196 | icon(icon_path) then header_cell((HTML_Off_Form)image([], icon_path, "")) |
| 195 | 197 | }, |
| 196 | 198 | make_header(_T, t, [cell . so_far]) | ... | ... |
database/vtm/view_table_types.anubis
web/CXM_form.anubis
| ... | ... | @@ -488,7 +488,7 @@ public define HTML_In_Form |
| 488 | 488 | checkbox_hide_show(options, _label, wan, val, checked, fields) then |
| 489 | 489 | with div_id = generate_random_string(15), |
| 490 | 490 | sequence([ |
| 491 | - check_box([data("show_id", div_id), class("in"), class("cxm_checkbox_hide_show"), event(onclick, "checked_hide_show_element('"+div_id+"', this);")], _label, html_Id(""), wan, val, get_Bool(lwa, wan.name, checked)), | |
| 491 | + check_box([data("show_id", div_id), class("in"), class("cxm_checkbox_hide_show"), event(onclick, "checked_hide_show_element('"+div_id+"', this);")], _label, html_Id("checkbox_"+div_id), wan, val, get_Bool(lwa, wan.name, checked)), | |
| 492 | 492 | div([id(div_id), style("display:"+if checked then "block" else "none")], sequence(map((CXM_Form_Field ff2) |-> div([class("form_field")], format_CXM_Form_Field(ff2, lwa)),fields))) |
| 493 | 493 | ]), |
| 494 | 494 | |
| ... | ... | @@ -498,7 +498,7 @@ public define HTML_In_Form |
| 498 | 498 | radio_button_hide_show(options, _label, wan, val, checked, fields) then |
| 499 | 499 | with div_id = generate_random_string(15), |
| 500 | 500 | sequence([ |
| 501 | - radio_button([data("show_id", div_id), class("in"), class("cxm_radio_hide_show"), event(onclick, "radio_hide_show_group('"+wan.name+"', this);")], _label, html_Id(""), wan, val, get_Bool(lwa, wan.name, checked)), | |
| 501 | + radio_button([data("show_id", div_id), class("in"), class("cxm_radio_hide_show"), event(onclick, "radio_hide_show_group('"+wan.name+"', this);")], _label, html_Id("radio_button_hide_show_"+div_id), wan, val, get_Bool(lwa, wan.name, checked)), | |
| 502 | 502 | div([id(div_id), style("display:"+if checked then "block" else "none")], sequence(map((CXM_Form_Field ff2) |-> div([class("form_field")], format_CXM_Form_Field(ff2, lwa)),fields))) |
| 503 | 503 | ]), |
| 504 | 504 | ... | ... |
web/CXM_making_a_web_site.anubis
| ... | ... | @@ -1252,6 +1252,8 @@ public type HTML_In_Form: |
| 1252 | 1252 | 'HTML_In_Form' defines all the elements you may put within a form. We define a |
| 1253 | 1253 | convenience function: |
| 1254 | 1254 | |
| 1255 | +public define HTML_In_Form text_input(HTML_Label label, HTML_Id id, WebArgName name, InitialValue init, Int width) = text_input([], label, id, name, init, width). | |
| 1256 | + | |
| 1255 | 1257 | public define HTML_In_Form literal(Printable_tree t) = literal_pt(t). |
| 1256 | 1258 | |
| 1257 | 1259 | public define HTML_In_Form image(String url) = image([], url, url). | ... | ... |
web/jQuery/CXM_jquery_datatable.anubis
| ... | ... | @@ -46,11 +46,15 @@ public define List(HTML_Head_Tag) |
| 46 | 46 | [ |
| 47 | 47 | //css(css_file("jquery/plug-in/DataTables-1.10.7/media/css/jquery.dataTables.min.css")), |
| 48 | 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 | 58 | // css(css_file("jquery/plug-in/DataTables-1.10.7/extensions/Responsive/css/dataTables.responsive.css")), |
| 55 | 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 | 82 | = |
| 79 | 83 | if enable_jqueryui then |
| 80 | 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 | 86 | table |
| 83 | 87 | ) |
| 84 | 88 | else |
| ... | ... | @@ -106,22 +110,23 @@ public define HTML_Partial_Content |
| 106 | 110 | partial_content( jquery_datatables_1_10_init + |
| 107 | 111 | [ |
| 108 | 112 | js_inline(jquery_ready(" |
| 113 | + $.fn.dataTable.ext.legacy.ajax = true; | |
| 109 | 114 | $('#"+table_id+"').dataTable( |
| 110 | 115 | { |
| 111 | 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 | 120 | // responsive: true,"+ |
| 116 | 121 | |
| 117 | 122 | if scrollY is |
| 118 | 123 | { |
| 119 | 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 | 130 | get_datatable_translation(lang, web_dir)+ |
| 126 | 131 | jquery_datatable_extra_to_string(extra)+ |
| 127 | 132 | "}); | ... | ... |