eduardosuruagy Posted July 9, 2020 Share Posted July 9, 2020 I have a UniSyntaxEdit component and I would like to get only the selected text, would I have it? Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted July 14, 2020 Author Share Posted July 14, 2020 Can anyone help me on this topic? Thank you! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 14, 2020 Share Posted July 14, 2020 On 7/9/2020 at 5:46 PM, eduardosuruagy said: have a UniSyntaxEdit component and I would like to get only the selected text, would I have it? Hello, On the client side or on the server side? Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted July 14, 2020 Author Share Posted July 14, 2020 52 minutes ago, Sherzod said: Olá, No lado do cliente ou no lado do servidor? It can be on the server side, I wanted to take the selected text and execute a command in the bank with it Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 15, 2020 Share Posted July 15, 2020 16 hours ago, eduardosuruagy said: It can be on the server side, I wanted to take the selected text and execute a command in the bank with it Hello, You can try to use this approach. 1. UniEdit1.Visible = False 2. UniSyntaxEdit1.ClientEvents.UniEvents -> function beforeInit(sender, config) { config.listeners = { initialize: ()=> { sender.codeEditor.editor.doc.addEventListener('selectionchange', ()=> { //ajaxRequest(sender, 'selectionchange', ['selectedText=' + sender.codeEditor.selection()]); MainForm.UniEdit1.setValue(sender.codeEditor.selection()) }, false); } } } 3. Usage... procedure TMainForm.UniButton1Click(Sender: TObject); begin ShowMessage(UniEdit1.Text); end; Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted July 15, 2020 Author Share Posted July 15, 2020 3 hours ago, Sherzod said: Hello, You can try to use this approach. 1. UniEdit1.Visible = False 2. UniSyntaxEdit1.ClientEvents.UniEvents -> function beforeInit(sender, config) { config.listeners = { initialize: ()=> { sender.codeEditor.editor.doc.addEventListener('selectionchange', ()=> { //ajaxRequest(sender, 'selectionchange', ['selectedText=' + sender.codeEditor.selection()]); MainForm.UniEdit1.setValue(sender.codeEditor.selection()) }, false); } } } 3. Usage... procedure TMainForm.UniButton1Click(Sender: TObject); begin ShowMessage(UniEdit1.Text); end; If I change the MainForm in that part MainForm.UniEdit1.setValue (sender.codeEditor.selection ()) and put a Frame works too? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 15, 2020 Share Posted July 15, 2020 2 minutes ago, eduardosuruagy said: If I change the MainForm in that part MainForm.UniEdit1.setValue (sender.codeEditor.selection ()) and put a Frame works too? Have you tried? Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted July 15, 2020 Author Share Posted July 15, 2020 25 minutes ago, Sherzod said: Have you tried? Yes, it worked. Thanks a lot for the help! 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.