Current filter:
                                You should refresh the page.
                                  • [DevExpress Support Team: CLONED FROM T421825: RichEdit - A custom save button]
                                    Hi Jenny,

                                    I have another requirement. After saving the document, I want to retain the cursor position in the document. The above approach does not allow that since it reloads the document.

                                    Please help with a solution. Is there any way to call server methods using custom ajax?

                                1 Solution

                                Creation Date Importance Sort by

                                Hello Aditya,

                                It is possible to accomplish this task on the client side. Save a value of the ASPxClientRichEdit.selection.intervals property to any JavaScript variable before saving the document.

                                [JavaScript]
                                var savedPosition; var CallbackSaveDocumentIsSent=false; $('#savebtn').click(function (ele) { savedPosition = RichEdit.selection.intervals; CallbackSaveDocumentIsSent=true; RichEdit.PerformCallback({ "mode": save}); });

                                Handle the ASPxClientRichEdit.EndCallback event to restore a cursor position:

                                [JavaScript]
                                function OnRichEditEndCallback(s, e) { if(CallbackSaveDocumentIsSent){ RichEdit.selection.intervals=savedPosition; CallbackSaveDocumentIsSent=false; } }

                                Please note that the CallbackSaveDocumentIsSent variable in my code allows you to determine if the current callback was sent to save a document.

                                • Aditya Kumar 8 09.01.2016

                                  Hi Jenny,

                                  I have tried it but gives an error on the line "savedPosition = RichEdit.selection.intervals;"

                                  please see the attachment.

                                • Jenny (DevExpress Support) 09.01.2016

                                  Hello Aditya,

                                  Would you please clarify what version of our products you are using?  Is it the latest one 16.1.5?

                                • Aditya Kumar 8 09.02.2016

                                  version 15.2

                                • Aditya Kumar 8 09.02.2016

                                  I tried with latest version 16.1. There is no error but it does not maintain the cursor position after saving

                                • Jenny (DevExpress Support) 09.02.2016

                                  Hello Aditya,

                                  This functionality was added in version 16.1. That is why an error occurs in Build 15.2.

                                   >>There is no error but it does not maintain the cursor position after saving
                                  I've created a project that demonstrates how to restore the cursor position. Would you please update my project to reproduce the issue and send it back to me for further research?