Current filter:
                                You should refresh the page.
                                  • [DevExpress Support Team: CLONED FROM T800698: Web: How to add an action (ribbon or context menu) to the richt text editor and show a popup view]

                                    The code looks like this:

                                    [C#]
                                    setTimeout(() => {{ var rich = ASPxClientRichEdit.GetControlCollection().GetByName('rtfAuditObjective'); var intervals = [{"start":237,"length":0}]; var field = rich.document.activeSubDocument.findFields(intervals[0].start)[0]; if (field && field.isHyperlink) { var hyperlinkSettings = { url: 'http://localhost:2064/Amx_Audit_DetailView/4ef43945-60c0-4c48-bda4-57f3f3f6c512', text: '2019-001 test x', tooltip: 'xxx' }; alert('This alert does appear'); rich.commands.changeHyperlink.execute(field.index, hyperlinkSettings); alert('This alert does not appear'); } }}, 0);

                                    I debugged all lines with alerts, and the result is that the field is found and the field is a hyperlink, but in the end the hyperlink is not changed and the last alert is not executed. So I suppose that the command crashes. Do you have an idea? Why can the command fail even though the parameters seem to fit?

                                    I was able to solve it my self. The "optional" subdocumentId parameter needs to be specified:

                                    [C#]
                                    ... "rich.commands.changeHyperlink.execute(field.index, hyperlinkSettings, rich.document.activeSubDocument.id); " + ...

                                    Maybe you could explain in your documentation when this optional parameter is needed:
                                    https://docs.devexpress.com/AspNet/js-ChangeHyperlinkCommand.execute(fieldIndex-hyperlinkSettings)

                                1 Solution

                                Creation Date Importance Sort by

                                Hello Bernd,

                                Thank you for pointing this out. "subdocumentId" is an optional parameter and the execute method should work properly for the changeHyperlink command. I've created the
                                RichEdit - The "Cannot read property 'fields' of undefined" error occurs when the changeHyperlink command is executed without an optional subDocumentId parameter report regarding this issue and we will update it once we have any news.