From d169d6079aaa2b2a29f999b0047feb3d057f84b1 Mon Sep 17 00:00:00 2001 From: totoro Date: Sun, 23 Oct 2022 17:41:01 +0200 Subject: [PATCH] add label and column name in primary_key alternative. This allows to see and edit the DB_id other than the first "id" --- view/jqgrid.anubis | 7 ++++++- view/types/hk_view.anubis | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/view/jqgrid.anubis b/view/jqgrid.anubis index 412f7e1..a3d9c60 100644 --- a/view/jqgrid.anubis +++ b/view/jqgrid.anubis @@ -114,7 +114,12 @@ define String with empty_referer = hk_referer("","","",""), with result = if model is { - primary_key then "{ name: 'id', hidden:true }", + primary_key(label,column_name) then + if column_name = "id" then + "{ name: 'id', label:'id', editable:false}" + else + "{ name: '"+column_name+"', label: "+to_JS_String(_T(label))+", editable:true, autoResizable: true, template: 'integer' }" + , information(label,column_name,width,help) then "{ name: '"+column_name+"', label: "+to_JS_String(_T(label))+", autoResizable: true, "+search_options(column_name)+"}", text(label,column_name,help) then "{ name: '"+column_name+"', label: "+to_JS_String(_T(label))+", editable:true, autoResizable: true, "+search_options(column_name)+" }", password(label,column_name,help) then "{ name: '"+column_name+"', label: "+to_JS_String(_T(label))+", autoResizable: true }", diff --git a/view/types/hk_view.anubis b/view/types/hk_view.anubis index cd06886..d086cfb 100644 --- a/view/types/hk_view.anubis +++ b/view/types/hk_view.anubis @@ -57,7 +57,7 @@ read hayamiki_lib/view/types/hk_form_tab.anubis public type VT_view_model_entry: //hidden (String name, String value), - primary_key , + primary_key (String label, String column_name), information (String label, String column_name, Int width, HK_Help_Text help), //s_name = show_name for translation, v_name = string to show text (String label, String column_name, HK_Help_Text help), //s_name = show_name for translation, c_name = table column name password (String label, String column_name, HK_Help_Text help), //s_name = show_name for translation, c_name = table column name -- libgit2 0.21.4