erich.wanker Posted June 21, 2023 Share Posted June 21, 2023 Hello, i have a Uniframe - in this i have a UniDBMemo ... i use "document.getElementById('O73A_id-inputEl'); " in ClientEvent->ExtEvent to change the scroll position of this UniDBMemo but what is the right way? .. the id of the element (which i found in Chrome DevTools) can be changed if i delete or add componens to my UniFrame ? ThanX Erich Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 21, 2023 Share Posted June 21, 2023 Hello @erich.wanker Yes, never use it like that! Where are you using this code? Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted June 21, 2023 Author Share Posted June 21, 2023 i have a Uniframe - in this i have a UniDBMemo1 .. and a TuniContainerpanel The UniContainerpanel has in ClientEvents -> ExtEvents following: function afterrender(sender, eOpts) { sender.getEl().dom.addEventListener('wheel', function(e) { e.preventDefault(); ele = document.getElementById('O73A_id-inputEl'); ele.scrollTop += e.deltaY; }, false); } Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted June 21, 2023 Author Share Posted June 21, 2023 OK .. i made a WorkAround 😉 procedure Tf_project_main.UniFrameCreate( Sender : TObject ); begin UniContainerpanel.ClientEvents.ExtEvents.Add('OnAfterrender=function OnAfterrender(sender, eOpts)'+ '{ sender.getEl().dom.addEventListener('+#39+'wheel'+#39+', function(e) { e.preventDefault();'+ 'ele = document.getElementById('+#39+ unidbmemo1.JSName+'_id-inputEl'+#39+');'+ 'ele.scrollTop += e.deltaY;'+ '}, false); }' ); Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 21, 2023 Share Posted June 21, 2023 51 minutes ago, erich.wanker said: i made a WorkAround Yes, but this is not a workaround, but one of the correct uses. 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.