This is a migrated thread and some comments may be shown as answers.
Editor in an SPA's View isn't working
6 Answers 45 Views
This is a migrated thread and some comments may be shown as answers.
Juan Jose
Top achievements
Rank 1
Juan Jose asked on 17 Dec 2015, 08:25 AM

Hi. I’m trying to use kendoEditor inside a View in a SPA.

When this View is shown for the first time the kendoEditors are built in its init(), and they render perfectly. Then, if I exit the view and try to load it again, this error appears in the console:

Uncaught TypeError: Cannot use 'in' operator to search for 'getSelection' in undefined kendo.web.min.js?version=1:35

I tried to do a refresh() of the editor in the show() of the view, but it doesn’t even get to enter it.
That’s in chrome.

In IE/Edge it breaks when loading the View for the first time: it renders (and the kendoEditors inside it), but the view that was previously loaded in that container is still there, below the new.

is there any solution?

Thanks

6 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 21 Dec 2015, 12:31 PM

Hello Juan Jose,

I tried to reproduce the problem in the following Dojo snippet, to no avail. Can you please adjust it so that it shows the problem?

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Juan Jose
Top achievements
Rank 1
answered on 22 Dec 2015, 08:40 AM

Hello,

 I did a little, very simple mockup of my app here:

http://dojo.telerik.com/uKuVI/3

Click edit button, make changes in any textarea, cancel, try to enter edit form again, this error displays in console:

Uncaught TypeError: Cannot use 'in' operator to search for 'getSelection' in undefined

 

 Thanks.

0
Alex Gyoshev
Telerik team
answered on 24 Dec 2015, 08:06 AM

Hello Juan Jose,

Since the editor widget is being moved in the DOM, it requires a call to its refresh method. You can call it on all editor widgets within the .main container with the following line:

    $(".main").find(kendo.roleSelector("editor")).kendoEditor("refresh");

Here is the updated Dojo snippet.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Juan Jose
Top achievements
Rank 1
answered on 28 Dec 2015, 08:43 AM

Hello,

That doesn't completely solve the problem.

In your Dojo snippet, try this: make changes in both editors, then click cancel, and click again edit. The

Uncaught TypeError: Cannot use 'in' operator to search for 'getSelection' in undefined 

errors keep appearing in the console and the edit view doesnt show. If you keep clicking Edit, it finally appears... but thats not usable.

Thanks again.

 

0
Petyo
Telerik team
answered on 30 Dec 2015, 08:44 AM
Hello,

thanks for the reproduction steps. Indeed, this seems so. We will need to investigate the causes further; Due to the holidays, our team is currently very short on staff, so please expect an additional response from us next week. I am sorry for the delay. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Alex Gyoshev
Telerik team
answered on 06 Jan 2016, 02:34 PM

Hello Juan Jose,

The issue is caused by the load_data method, which attempts to set the editor value while the iframe is in a broken state. If set after the editor content is refreshed, the problem disappears. We will investigate whether this can be handled by our code, but at this time you can resolve the problem by updating the editor value after the refresh call. Here is the updated Dojo snippet.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Asked by
Juan Jose
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Juan Jose
Top achievements
Rank 1
Petyo
Telerik team
Share this question
or