"Go" how to interact with the code between HTML and Delphi(2015-11-19 22:16:24)
reproduced
Tags: it |
Category: Unigui |
In the total group of Unigui
Taichung CMJ FriendsFor us to summarize the following content, for the use of Delphi+unigui development of applications, can be said to be fine, must be mastered.
In a word, how to interact with the code between HTML and Delphi is the best answer.
[Clientevents Operation]
JS Access Edit,memo element value Getvalue,setvalue
MainForm.Edit1.setValue ("ABCDE"); Set the value to Edit1
EXT.GETCMP (MainForm.Edit1.id). SetValue (value); Set the value to Edit1
MainForm.Edit1.getValue (); Take the value of Edit1
EXT.GETCMP (MainForm.Edit1.id). GetValue ());
JS Access label
MainForm.Label1.setText (value); Setting
EXT.GETCMP (MainForm.Label1.id). SetText (value);
EXT.GETCMP (MainForm.Label1.id). GetWidth (); Take the width of
var a=document.getelementbyidx_x (MainForm.Label1.id). InnerText; Take value
var a=ext.getcmp (MainForm.Label1.id). text; Take value
MainForm.UniButton4.getId (); Take Unigui control ID
MainForm.UniButton4.id; Take Unigui control ID
[Use of Uniurlframe]
UniLoginForm1.UniURLFrame1.iframe.contentWindow.document.getElementByIdx_x (' container ').
Innerhtml= ";
UniLoginForm1.UniURLFrame1.iframe.contentWindow.oldPoint = null;
Top.document.getElementByIdx_x (top. MainForm1.BT_del.getId ()). Click ();
Top. Mainform.uniedit1;
You can use Top.form directly in the Uniurlframe. Control
This is ExtJS sealed.
Top.ajaxrequest (top. mainform.uniurlframe1, ' testevent ', null);
The UniURLFrame1 of this service end will be onajaxevent.
So we have a theory.
Use ExtJS in Uniurlframe to add top.
Controls such as top. Mainform.uniedit1
Functions such as Top.ajaxrequest
An example of Ajax in a multi-participant demo
Simple use of Delphi
Unisession.addjs (); To execute JS code.
[Unigui reference to custom JS files]
Example: Test.js stored under files\
Content: function AA () {
Alert ("AA");
}
Reference: Uniservermodule customfile setting
Files/public.js
Or
Files\public.js
Use 1: The program in Delphi
Unisession.addjs (' AA (); '); Definition in Uniguiapplication
Use 2: Inside the Extevents.onclick of the component (control)
Alert ("AA");
In conclusion:
1. How to take HTML in Delphi?
2. How to fetch Unigui in JS
3.js->delphi using Ajax
4.delphi Ajax onajaxevent Programming in the control's
Ueditor should be HMTL with Ajax->delphi is HTML string
"Go" how to interact with the code between HTML and Delphi