This is a migrated thread and some comments may be shown as answers.

Tag Helper - Editor For

1 Answer 110 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Joshua
Top achievements
Rank 2
Joshua asked on 08 Aug 2018, 12:24 PM

I have a simple tag helper for my editor. I am using the 'For' attribute because I am binding to a viewmodel. When the property for this viewmodel is loaded, by default, it loads in as null because its a new object. In other words, my ViewModelObject has a property called 'Content' and that is a string that is null when created. So, when I use this code below in my Razor view, it returns back an error that object is not initialized. But if I set that property to an empty string ("") then it will load fine.

So the question is, is this expected behavior or should it still load regardless? My opinion, it shouldn't matter if it is null or not. It should still give a blank editor.

Thanks

<kendo-editor for="Content">
    <resizable enabled="true" />
    <content>
 
    </content>
    <tools>
        <tool name="formatting" />
        <tool name="bold" />
        <tool name="italic" />
        <tool name="underline" />
        <tool name="justifyLeft" />
        <tool name="justifyCenter" />
        <tool name="justifyRight" />
        <tool name="insertUnorderedList" />
        <tool name="insertOrderedList" />
        <tool name="indent" />
        <tool name="createLink" />
        <tool name="tableEditing" />
    </tools>
</kendo-editor>

1 Answer, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 13 Aug 2018, 08:29 AM
Hi Joshua,

You are perfectly right. The Editor widget in this case would be expected to be loaded properly with no value (as the HTML helper loads). That is why the observed should be considered a bug in the Tag helper functionality. Here you could find the GitHub item where you could track its status.

As a small token of gratitude for the reported, I have updated your Telerik points. Keep in mind, that at this stage. I won't be able to offer you a workaround for the discussed. Therfore, I would suggest you to keep tracking the bug issue and update the Kendo version as soon as the fix is available.

In case you have any other questions, please do not hesitate to contact us.

Regards,
Veselin Tsvetanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Editor
Asked by
Joshua
Top achievements
Rank 2
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or