Commit 627c1be7065c96f726ab9795e6f4b260a0a6cda0

Authored by totoro
1 parent 87cb5f32

add grid_action management in web action name

view/jqgrid.anubis
... ... @@ -66,7 +66,7 @@ public define String
66 66 )=
67 67 "colModel: [\n"+
68 68 join(",\n ",
69   - [ "{name: 'myac', label: 'Action', width:60, fixed:true, sortable:false, resize:false, formatter:'actions', formatoptions:{keys:true}}" .
  69 + [ "{name: 'myac', label: 'Action', width:65, fixed:true, sortable:false, resize:false, formatter:'actions', formatoptions:{keys:true}}" .
70 70 map((VT_view_model_entry col_model) |-> to_jqGrid_ColModel(db, col_model, _T), models)
71 71 ]
72 72 )+
... ...
view/view_table_renderer.anubis
... ... @@ -144,6 +144,7 @@ define String
144 144 (String) -> String _T
145 145 )=
146 146 "
  147 + editurl: '?aws_controller=hk_c&aws_action=grid_action&table_name="+rows.table_name+"',
147 148 iconSet: \"fontAwesome\",
148 149 autowidth:true,
149 150 shrinkToFit:true,
... ... @@ -153,9 +154,25 @@ define String
153 154 cellurl: '?aws_controller=hk_c&aws_action=update_row&table_name="+rows.table_name+"',
154 155 pager: '#"+uid+"_pager',
155 156 caption:"+to_JSON_String(_T(to_upper(rows.table_name)))+",
156   - ondblClickRow: function( rowid) {"+
157   - jq_dialog_open(dialog_id(uid+"edit_table_dlg_ajax"), "'id='+rowid")+
158   - "}"
  157 + actionsNavOptions: {
  158 + openicon: \"fa-folder-open-o\",
  159 + opentitle: \"Open (Enter)\",
  160 + isDisplayButtons: function (options, rowData) {
  161 + if (options.rowData.closed) { // or rowData.closed
  162 + return { post: { hidden: true }, del: { display: false } };
  163 + }
  164 + },
  165 + custom: [
  166 + { action: \"open\", position: \"first\",
  167 + onClick: function (options) {"+
  168 + jq_dialog_open(dialog_id(uid+"edit_table_dlg_ajax"), "'id='+options.rowid")+
  169 +"
  170 + }
  171 + }
  172 + ]
  173 + }"
  174 +// ondblClickRow: function( rowid) {"+
  175 +// jq_dialog_open(dialog_id(uid+"edit_table_dlg_ajax"), "'id='+rowid")+
159 176 .
160 177  
161 178 public define HTML_Partial_Content
... ... @@ -175,7 +192,7 @@ public define HTML_Partial_Content
175 192 to_jqGrid_ColModel(db, _T, rows.view_model.list)+","+
176 193 // rows.json_data_string+
177 194 jqGrid_options(uid, rows, _T)+
178   - "})")),
  195 + "}).jqGrid(\"gridResize\");")),
179 196  
180 197 partial_content(jqgrid_init(lang) + [js],
181 198 div([],
... ...
view/web_action.anubis
... ... @@ -12,6 +12,7 @@ read calexium_lib/web/CXM_making_a_web_site.anubis
12 12  
13 13 public define WEB_Action_Name hkc_edit_table = controller_action("hk_c", "edit_table").
14 14 public define WEB_Action_Name hkc_grid_view = controller_action("hk_c", "grid_view").
  15 +public define WEB_Action_Name hkc_grid_action = controller_action("hk_c", "grid_action").
15 16 public define WEB_Action_Name hkc_view_table = controller_action("hk_c", "view_table").
16 17 public define WEB_Action_Name hkc_save_row = controller_action("hk_c", "save_row").
17 18 public define WEB_Action_Name hkc_save_row_and_new = controller_action("hk_c", "save_row_and_new").
... ...