Rekit Docs
  • Getting Started
  • Overview
  • Application Types
  • Command Line Interface
  • Element
  • Project Explorer
  • Diagramming
  • Tabs Bar
  • Code Editor
  • Bottom Drawer
  • Move/Rename
  • Rekit Development
    • Create a Rekit Plugin
      • Application Plugin
    • Get Started
    • Extension Point
    • Provide Project Data
    • Define a New Type of Element
      • Manage Element
      • Core Dialog
      • Form in the Dialog
    • Customize Menus
    • Plugin Architecture
    • Plugin Development
    • Hooks
    • Form Builder
    • API reference
      • Overview
      • Extend layouts
  • Application Types
    • Rekit React
      • Overview
      • Element Types
      • Customize Templates
      • Redux Management
      • React Router
      • Styling
      • Build
      • Testing
    • Create React App
    • Rekit Plugin
    • VueJS
    • AngularJS
Powered by GitBook
On this page

Was this helpful?

  1. Rekit Development
  2. Define a New Type of Element

Core Dialog

Core dialog is used to adding new elements with a form.

Show a Dialog

To show the dialog, use the action core/redux/showDialog :

import * as actions from 'rs/features/core/redux/actions';
import store from '../../../common/store';

const showDialog = (...args) => store.dispatch(actions.showDialog(...args));

showDialog accepts below arguments:

showDialog(formId, title, context)

Argument

Type

Description

formId

string

Which form to show in the dialog

title

string

Title of the dialog

context

object

The context for the form to render fields and submit values.

The context object usually has below fields:

Property

Type

Description

action

string

The action to manage element

targetId

string

Which element is the action applied.

elementType

string

When create, the type of the element to create.

Besides the context before, all values user input in the form are provided to Rekit core command.

Then you can use showDialog in your logic like handleMenuClick:

menu.contextMenu.handleMenuClick(key) {
  switch (key) {
    case 'plugin-default-new-file':
      showDialog('core.element.add.file', 'New File', {
        action: 'add',
        targetId: null,
        elementType: 'file',
      });
      break;
    case 'plugin-default-new-folder':
      showDialog('core.element.add.folder', 'New Folder', {
        action: 'add',
        targetId: null,
        elementType: 'folder',
      });
      break;
    default:
      break;
  }
}
PreviousManage ElementNextForm in the Dialog

Last updated 6 years ago

Was this helpful?