Skip to content

HowToAction

iraichi edited this page Apr 24, 2015 · 9 revisions

How to add an action button to the toolbar in a View

Please refer here for general informations about Views and Action Controllers.

if you want to add one or more action buttons to a View toolbar, you have to implement a ToolController in MainTable/Controller/ToolViews node and set the specific parameters for the tool.

Example from HelloKitto: two buttons added to export data in Text and CSV format(standard tools)

# view dolls.yalm

Type: Data
.....
MainTable:
  Model: Doll
  Fields:
.....
  Controller:
.....
    ToolViews:
      DownloadText:
        DisplayLabel: _(Download in TXT)
        Controller: ExportTextTool
          RequireSelection: False
          IncludeHeader: False
          ClientFileName: DollList.txt
      DownloadCSV:
        DisplayLabel: _(Download in CSV)
        ImageName: download
        Controller: ExportCSVTool
          RequireSelection: False

You can use one of the standard controllers included in Kitto or define a new one by your own. In this case you have to:

Clone this wiki locally