Jump to content

What must i use instead of "document.getElementById('O73A_id-inputEl'); "


erich.wanker

Recommended Posts

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

Link to comment
Share on other sites

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);
}
Link to comment
Share on other sites

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); }' );


 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...