在Spotfi中实现Javascript

2024-09-28 05:26:03 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个下拉列表,有两个值(“开始”和“结束”)。对于这个下拉值,我想显示一个特定的DIV或另一个。在

我试图实现下面的代码,但它不起作用。当我更改下拉输入中的值时,什么都不会发生。在

下拉标识为:5e64c4918c4b473a8ed1c55264aca3d9。在

HTML代码:

<P align=left><FONT size=2>Choice : <SpotfireControl id="5e64c4918c4b473a8ed1c55264aca3d9" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>
<DIV id="div1"><FONT size=2>List 1 :&nbsp;</FONT>&nbsp;<SpotfireControl id="5f252f7f373d48debc33bfde6fd7dd65" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>
<DIV id="div2"><FONT size=2>List 2 :</FONT> <SpotfireControl id="136584e6f10143c9ade2a82f5cf4fef0" /></DIV>
<P>
<P align=left>&nbsp;</P>
<P align=left>&nbsp;</P>
<P align=left>&nbsp;</P>
<P><SpotfireControl id="42a0fbc386184501903389b4c48155a5" /></P>        

我的Javascript代码如下:

^{pr2}$

我还创建了一个iron python脚本,链接到我的下拉列表:

Ironpython脚本:

from Spotfire.Dxp.Application.Visuals import HtmlTextArea
ta.As[HtmlTextArea]().HtmlContent += " "

其中,ta是“可视化”类型的输入。在

你能帮帮我吗?在

提前谢谢


Tags: 代码div脚本id列表sizeleftlist
1条回答
网友
1楼 · 发布于 2024-09-28 05:26:03

作为点击不支持,我已删除点击声明和它的工作!在

//Triggering the script if Drop Down selection is varied
var value = $("#5e64c4918c4b473a8ed1c55264aca3d9").val();  //To capture the index
var vt = $("#5e64c4918c4b473a8ed1c55264aca3d9").text(); //To Capture the  selected text
if(vt== "START")   //If the Drop Down selected value is Enable
{
  $("#div1").show(); //Making the Input Box visible 
  $("#div2").hide();
}else{
  $("#div1").hide(); //Making the Input box element hidden
  $("#div2").show();
};

相关问题 更多 >

    热门问题