How to set a initial value for an Editor component

3 posts, 0 answers
  1. Dongsheng
    Dongsheng avatar
    4 posts
    Member since:
    Jul 2018

    Posted 17 Jul 2018 Link to this post

    Hi,

    I am using the "kendo-editor-react-wrapper" in my project, and I want to set a initial value for the Editor component. But I cannot find any helpful thing in EditorOption (including change, keyup, keydown, tools, …, etc.)

    I know that I can use Editor.value() to set a value for an editor object, but how can I do this in React?

    I found someone wrote like <Editor value={the_value} /> : https://stackoverflow.com/questions/48704782/kendo-editor-react-wrapper-display-an-error 

    But when I try to write like this, I got an error: " TS2339: Property 'value' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Editor> & Readonly<{ children?: ReactNode; }> & Re...'."

     

    ReactJS 15.6.1 and Typescript 2.4.1 are used in my project.

    Maybe I have made some stupid mistakes, but I would be grateful if you could provide a solution or suggestion.

  2. Stefan
    Admin
    Stefan avatar
    2826 posts

    Posted 17 Jul 2018 Link to this post

    Hello, Dongsheng,

    Thank you for the information.

    This is an issue which is already fixed and it will be available in the latest version of the Editor.

    Also, currently the content can be set  by adding a teaxarea element and pass the content string as children:

    <Editor height={500}>
        <textarea>
            {this.props.value}
        </textarea>
    </Editor>

    I hope this is helpful.

    Regards,
    Stefan
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Dongsheng
    Dongsheng avatar
    4 posts
    Member since:
    Jul 2018

    Posted 17 Jul 2018 in reply to Stefan Link to this post

    Hi Stefan,

    Thanks a lot. This works fine for me.

Back to Top