Trend Object in code behind of HTML5 Display

Dear Expert
In my project, I created the Html5 Display.
Inside it, I use Trend Object.
How can I use this Trend Object’s Properties Javascript code behind ?
Thank much.

Hi Manh,

You can obtain control of the object and access its properties using the following syntax:

var trendControl = null;
this.DisplayIsOpen = function()
{
	trendControl = this.CurrentDisplay.GetControl("trend");
}

If you have any questions, we are available.

Best Regards,
Tatsoft Team.

Dear Sir
Thank for your feedback.
I have some doubts please

  1. As your declaration, “trendControl = this.CurrentDisplay.GetControl(“trend”)”. How to determine which Object " trendControl " belong to ? Because , in Display has many Objects.
    2.I tried do that, but There is no properties/function suggestion list when I type dot charactor.
  2. One other problem. I create Popup window and a button to open this popup in HTML5. But it can’t work.
    Best

Hi Manh,

1.You need to use the same Uid of the TrendWindow object you want to take control of with “trendControl = this.CurrentDisplay.GetControl(‘trend’);”. Here is an example below.

image

image

  1. To access the properties of an HTML5 object’s control, use a debugger after obtaining the control of the object in the CodeBehind. In DevTools, type in the console to access the object’s properties, as shown in the image below.

image

  1. To open a popup in HTML5, follow the steps below:
    A. Create a ‘New Display’ with the Type ‘HTML5 Client’.

image

B. In the created Display, under Display Settings, change to ‘Popup’.

C. Use the methods below to open the Popup.

Action > OpenDisplay.

Action > RunScript.

@Client.NewPopup(“Popup Name”);
@Client.OpenDisplay(“Display Name”);
@Display.DisplayName.Open();

image

If you have any questions, we are available.

Best Regards,
Tatsoft Team.

Dear Sir
Thank much for your feedback.

  1. I uderstood. And How can I declare event of in in javascript?
  2. It’s wonderfull.
  3. I opened the popup. But The popup always open at top of website. I can move the popup to left to right but up and down couldn’t. I tried with all of Window and mouse Target.