Textarea - RRZE-PP/grails-cmeditor GitHub Wiki

You can substitute a <g:textArea name=""/> with <cmeditor:textArea name=""/>.

Available options here are:

  • availableModes: List of Strings, all the modes (CodeMirror lingo for filetypes) the editor should make available. For a list see https://codemirror.net/mode/
  • availableThemes: List of Strings, all the themes the editor should make available. For a list see https://codemirror.net/demo/theme.html
  • binding: the initial key-binding of the editor (e.g. vim)
  • mode: the default mode for the editor to use (e.g. text/x-groovy)
  • readOnly: Boolean, whether to make the textArea readOnly; default: false
  • options: a collection defining additional options:
    • binding: String, overrides the binding-attribute
    • menu: Boolean, whether to display a menu bar or not; default: true
    • menuFile: Boolean, whether to display a file menu or not; default: false
    • menuView: Boolean, whether to display a view menu or not; default: true
    • mode: String, overrides the mode-attribute
    • overlayDefinitionsVar: String, a js-variable name in which you can define additional CodeMirror overlays
    • preloadModules: Boolean, whether the editor should load all themes and modes on document load; default: false
    • readOnly: Boolean, overrides the readOnly-attribute
    • theme: String, overrides the theme-attribute
    • useSession: Boolean, whether to save editor state in the user's browser; default: true
  • theme: the initial theme to use
  • value: The initial value to put in the text area

So for example use: <g:textArea name="foobar" binding="vim" options="[readOnly: true"] />