用于coldfusion中多个动态链接的Jquery对话框

时间:2014-04-03 18:49:34

标签: jquery coldfusion

我在coldfusion,jquery中创建一个事件日历。我有以下代码。如果我只有一个事件,即每天一个链接,并单击该对话框打开。当我有一天多个事件/超链接时,它不会打开对话框来显示事件详细信息,而是当我点击第二个链接时页面正在重新加载....有人可以指出有什么问题吗?这段代码?

 <table id="calendar" align="center">
      <tr>
         <td class="cal-nav">
         <font color="##FFFFFF">   <a href="#cp#?date=#lastMonth#"><- Previous</a></font>
        </td>
         <td class="cal-hdr" colspan="5">
         <font color="##FFFFFF">   #DateFormat(thisMonth, "mmmm - yyyy")#</font>
        </td>
         <td class="cal-nav">
        <font color="##FFFFFF">    <a href="#cp#?date=#nextMonth#">Next -></a></font>
        </td>
      </tr>

      <tr align="center">
        <cfloop from="1" to="7" index="i">
        <td class="cal-day"><font color="##FFFFFF">#DateFormat(i, "DDDD")#</font></td>
        </cfloop>
      </tr>
      <tr> 
         <cfloop from="1" to="42" index="j">
            <cfif (j LTE 7) AND (DateFormat(thisMonth, "DDDD") IS DateFormat(j, "DDDD"))>
               <cfset showDays = true />
            </cfif>
            <cfif thisDay GT totalDays>
               <cfset showDays = false />
            </cfif>


            <cfif showDays>
               <cfset squareDate = "#DateFormat(thisMonth, "MM")#/#thisDay#/#DateFormat(thisMonth, "YYYY")#" />

               <td class="cal-square cal-day-active top <cfif squareDate EQ DateFormat(Now(), "MM/DD/YYYY")>cal-today</cfif>">
                  <table>
                     <tr>                    
                        <cfset duedate = DateFormat(getdetails.duedate, "MM/D/YYYY")>


                        <td>
                          <div>#thisDay#</div>                           
                         <cfloop query="getdetails">                                                   
                         <cfif #duedate# eq #squareDate#>
                           <div id="view-#thisDay#-#getdetails.motsid#" class="cal-event" style="margin-top:5px" > 

                           <a id="event" href="">
                   <cfif squareDate LT DateFormat(Now(), "MM/D/YYYY")><font color="red" ><strong>#getdetails.PROGRAM#</strong> <cfelse> #getdetails.PROGRAM#</font></cfif>
                           </a>                           
                           </div>
                          </cfif>                        
                          </cfloop> 

                          <cfloop query="getdetails">                                                   
                         <cfif #duedate# eq #squareDate#>
                           <div id="dialog-#thisDay#" class="window" title="#getdetails.PROGRAM#">                             
                              <div class="event-date">#DateFormat(duedate,"DDDD - MMMM DD, YYYY")#</div>
                              <div><p>MOTSID:#getdetails.motsid#</p></div>
                           </div>            
                         </cfif>                        
                          </cfloop> 





<script type="text/javascript">
                       $(function() {
                          $(".test-#thisDay#-#getdetails.motsid#").click(function(a) {                              
                             a.preventDefault();    
                             $('##dialog-#thisDay#').dialog('open');                                                        

                          });
                       });
              </script>




                        </td>


                     </tr>
                  </table>
               </td>
               <cfset thisDay = thisDay + 1 />
            <cfelse>
               <td class="cal-square cal-day-null"></td>
            </cfif> 
            <cfif j MOD 7 IS 0></tr>
               <cfif NOT j NEQ 42><tr></cfif>
            </cfif>
         </cfloop>
      </tr> 
</table>

0 个答案:

没有答案