link and window

link and window action type share same options. The difference is that, link option opens dialog in the same window, while window option opens dialog in a new window.

 

    10:
      type: link
or
      type: window

      caption: New closed element
      icon: edit
      url: /some_url?with_param=1
or
      controller: cmsedit
      action: new
      form_name: my_form_name
      table: my_table_name

      params:
        ids:
          object: params
          method: ids
        user_id:
          object: session
          method: user_id
        parent_id:
          object: record
          method: id
        p_state: closed
 
    confirm: Confirm action!


caption: caption written on action button.
 

icon: icon displayed before caption. Icon can be any of Font awesome icons or can be image defined in Rails assets.
 

url: direct url can be specified as link source.
 

but it is more common that DRG Forms dialog will be used as source of action. As result url will be constructed from these options:

 

controller: Rails controller name. Usually cmsedit


action: Rails action name inside controller (new, index)

 

table: table (model) name written in snake case

 

form_name: form name which will be used for data processing. If omitted defaults to table option.

 

params: Additional parameters can be send with calling url

Parameters can be constants.

      params:
        p_state: closed

 

Parameters can be taken from current environment params object.

      params:
        ids:
          object: params
          method: ids

 

Parameters can be taken from session object. Method option here indicates string or symbol of value saved in session hash object.

      params:
        user_id:
          object: session
          method: user_id

 

Parameters can be taken from current document if @record object is present in Rails environment.

      params:
        parent_id:
          object: record
          method: id

 

Object record is present in result_set actions and in form actions but not on index actions.


Last update: 18.04.2021