Static table - "Actions": How to add new options in a submenu

Hi all,

When creating a static table (v2) via custom screens, it is possible to add a new command for the "Actions" button at the bottom of the table using the following code.

table.setFieldValue("addCommandMenu", Map()
                    .insert("label", "Show all information")
                    .insert("url", getProgramBlogic() + "&action=doScreenDefinition&id=54&contact_id=" + companyId + "&show_all=yes")
                    .insert("iconUrl", getProgramBlogic().until("/CS") + "/CS/graphics/Seven/new.png")
                    .insert("target", "_parent"));

 

I was wondering if it is also possible to create a submenu, similar to the "Export" option we have here by default.

 

So, in short: can I create menu items which belong to a "main menu" (in the example above, "Export to Excel" is part of the "Export" menu). And of course, if yes...how? :-)

RE: Static table - "Actions": How to add new options in a submenu

Hi Bas,

It is possible to add a "menu" with items like you describe, however purpose of this is more to perform actions on selected items in your grid and not use for navigation.

To accomplish this you can do something like this:

dd.setFieldValue("addCommandMenu", Map().insert("label", "Foo"));
dd.setFieldValue("addCommand", Map().insert("title", "Show all information").insert("url", getProgramBlogic() + "?action=doScreenDefinition&id=54&contact_id=" + companyId + "&show_all=yes").insert("iconUrl", getProgramBlogic().until("/CS") + "/CS/graphics/Seven/new.png").insert("target", "_parent"));

Using this will append something like this to your url; &sessionObject=id:<id>&returnUrl=&__formKeyId=<id>

Results in ;

By: Michel Krohn-Dale 16 Jun 2021

RE: Static table - "Actions": How to add new options in a submenu

Thanks for the inspirational input Michel :)

By: Bas Kreijveld 16 Jun 2021