Jump to content

JavaScriptName .. i need a fix name or fix ID


erich.wanker

Recommended Posts

Hello,

 

i try to use JQuery..

 

in Servermodule / CustomFiles i have:

 
and it loads ..  a testalert is shown successful !
 
 
Now i have 2 basic questions:
 
1.)  the html-element-ID of the unigui-created components are not fix ... if i change in delphi something, the id´s are changed ..
How can i find per javascript the "mainform.uniPanel1" ?  
How can i Find the "myUniFrame.unipanel1"  - the frame is loaded in "mainform.displaypanel"?
- the javascripts are on the same server in subfolder /scripts
 
2.) if i click on uniButton1 - i read different Integer-Values (from query.fieldbyname .. from different calculations..)
How can i send as example - 3 different Integer-Values to a javascript, located on the same webserver in the subfolder /scripts ?
 
 
Thank you for your help
Link to comment
Share on other sites

Hi Erich.

 

Let's say you have a function on the webserver: 

function test (testname) {
   alert (testname);
}
uses ... UniGUIApplication ...

1. UniButton1.JSName + '_id'

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniSession.AddJS('test ('+'document.getElementById("'+ UniButton1.JSName +'_id").style.top);');
end;

2. Сan also send values:

procedure TMainForm.UniButton1Click(Sender: TObject);
var i: Integer;
begin
  i := 7;
  UniSession.AddJS('test ('+IntToStr(i)+');');
end;

Best Regards...

  • Upvote 1
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...