有没有人使用ExtLib的xe:calendarView控件?如果是这样,事件如何运作?

Jul*_*uss 7 xpages

我正在尝试在真实世界的应用程序中使用xe:calendarView控件.到目前为止,我可以从视图中读取数据并将其显示在日历中,这很容易.

但现在我想通过double或singleclick打开一个条目,或者我想通过拖放来改变条目的日期.为此,控件具有"onOpenEntry"之类的事件,我可以在其中编写SSJS.但我被困在这里:

  • 在这种情况下,如何获取生成事件的文档的UNID?"this"是com.ibm.xsp.extlib.dwa.component.calendar.UICalendarView对象.我找到了这个类的一些源代码,但我没有看到任何方法来访问应该打开的文档.

  • 此外,"onOpenEntry"事件仅在加载控件时触发一次.之后,它不会在点击或双击时触发.

对我来说,看起来这些事件并没有完全实现......而且在ExtLib演示数据库中也没有使用过.有谁知道这些东西是如何工作的?谢谢!

Tho*_*ian 2

您可以使用 dojo 或 jquery 将事件绑定到日历条目。我找到了包含 unid 的条目的以下代码。

所以你应该能够做这样的事情

  1. 找到 id ....calendarView1-entry0
  2. 获取unid属性
  3. 将 id 绑定到您想要的事件并执行弹出窗口或其他操作。

    <div id="home:_id1:dynC:_id556:calendarView1-entry0" class="s-cv-entry" calendar_type="Meeting" unid="723C2A5387AA7994C12579B30056D07E" calendar_date="20120622" calendar_index="0" calendar_start="20120622T000000,00$Z=-1$DO=1$DL=3 -1 1 10 -1 1$ZN=Western/Central Europe" calendar_end="20120622T010000,00$Z=-1$DO=1$DL=3 -1 1 10 -1 1$ZN=Western/Central Europe" calendar_start_notes="20120621T220000Z" calendar_bgcolor1="#C1DDF9" calendar_bgcolor2="#5495D5" calendar_fontcolor="undefined" calendar_bordercolor="undefined" calendar_external="0" onmouseover="dwa.cv.calendarView.prototype.cvHandler(event,this,'home:_id1:dynC:_id556:calendarView1');" onmouseout="dwa.cv.calendarView.prototype.cvHandler(event,this,'home:_id1:dynC:_id556:calendarView1');" onclick="dwa.cv.calendarView.prototype.cvHandler(event,this,'home:_id1:dynC:_id556:calendarView1');" ondblclick="dwa.cv.calendarView.prototype.cvHandler(event,this,'home:_id1:dynC:_id556:calendarView1');" oncontextmenu="dwa.cv.calendarView.prototype.cvHandler(event,this,'home:_id1:dynC:_id556:calendarView1');" style="top: 0px; left: 504px; width: 114px; height: 48px; "><canvas id="home:_id1:dynC:_id556:calendarView1-entry0-gradient" class="s-cv-entry" style="top:0px;left:0px;width:100%;height:100%;" color2="#C1DDF9" color="#5495D5" width="114" height="48"></canvas><div tabindex="0" class="s-cv-entry-innerframe s-cv-entry-innerframe-height s-cv-text" unselectable="on" aria-describedby="home:_id1:dynC:_id556:calendarView1-entry0-target" aria-haspopup="true" role="menu" style="top:0px;left:0px;width:100%;color:undefined;white-space: nowrap;" com_ibm_dwa_ui_draggable_redirect="home:_id1:dynC:_id556:calendarView1"><img alt="Meeting" src="/xsp/.ibmxspres/.dwa/common/images/transparent.gif" width="13" height="11" style="border-width:0px;background-position: -0px -0px; background-image: url(/xsp/.ibmxspres/.dwa/common/images/colicon1.gif);">&nbsp;Midsommar<br>8clfux40</div>
    
    Run Code Online (Sandbox Code Playgroud)