Configuring code mirrror in editable reports

(5 posts) (2 voices)

Tags:

No tags yet.

  1. maron, Member

    We are now using codemirror for editing quite a few reports. We are using it for editing components (html, javascript, css) - this was possible as a result of https://mydbr.com/forums/topic.php?id=2509#post-8152

    Thank you - highly useful.

    We can also use vim in the sql editor - again thank you, it works well so far and doubles productivity in the sql editor for some of us.

    However we cannot change the setting for the codemirror editor of the editable part, any chance to set it to include the header and maybe have access to some of the codemirror embedding options?

    Regards,

    Maron

  2. myDBR Team, Key Master

    We can take a look what we can do about it. Were there any specific features you were looking for?


    myDBR Team

  3. maron, Member

    In order of priority (and no need to implement all)

    1. Ability to define width and height of the editable object
    2. Editor type (Vim)
    3. Callback support works with jeditable but not with codemirror

    Is there maybe a way to edit the config object before loading?

  4. myDBR Team, Key Master

    1. Ability to define width and height of the editable object

    You can set the editing object's width and height with CSS:

    select 'dbr.css', '.CodeMirror {width: 600px;height:300px}';

    2. Editor type (Vim)

    We've added option code into the latest build which you can use to pass CodeMirror options in. To set the editor mode to vi use the keyMap setting:

    select 'dbr.editable', 'code', 'sp_DBR_edit_code', 'in_id=id', 'type=php', "options={'code':{'keyMap': 'vim'}}";

    3. Callback support works with jeditable but not with codemirror

    What do you mean by this? The editing callback should work in code editing as it works with other editing types.

    --
    myDBR Team

  5. maron, Member

    Perfect thanks. Fantastic to have access to all the codemirror options.

    Figured out the callback, what made me unsure is that in docs it can be understood that the callback is a jeditable option in the syntax section, which caused me to give up to soon.


Reply

You must log in to post.