eduardosuruagy Posted July 9, 2020 Posted July 9, 2020 I have a UniSyntaxEdit component and I would like to get only the selected text, would I have it? Quote
eduardosuruagy Posted July 14, 2020 Author Posted July 14, 2020 Can anyone help me on this topic? Thank you! Quote
Sherzod Posted July 14, 2020 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
eduardosuruagy Posted July 14, 2020 Author 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
Sherzod Posted July 15, 2020 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
eduardosuruagy Posted July 15, 2020 Author 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
Sherzod Posted July 15, 2020 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
eduardosuruagy Posted July 15, 2020 Author Posted July 15, 2020 25 minutes ago, Sherzod said: Have you tried? Yes, it worked. Thanks a lot for the help! 1 Quote
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.