"Go" how to interact with the code between HTML and Delphi

Source: Internet
Author: User

"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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.