2010-10-25 50 views
0

我有一個表,我需要上下移動元素。我有代碼工作,但只要我添加一個標籤,它會拋出錯誤:jQuery不分離()如果它包含輸入標籤'ing'

Error: this.visualElement is undefined 
Source File: http://192.9.199.11:83/templates/admin/js/jquery/ui.checkbox.js 
Line: 94 

的HTML看起來像這樣:

<table width="100%" cellpadding="0" cellspacing="0"> 
    <tr> 
     <th>Menu</th> 

     <td>Builds the main navigation menu panel</td> 
     <td width="80px"> 
      <input type="hidden" class="hiddenData" name="" value="1" /> 
      <a href="" title="Up" class="upArrow arrowButtons"></a> 
      <a href="" title="Down" class="downArrow arrowButtons"></a> 
     </td> 
    </tr> 

    <tr> 
     <th>Proudly Support</th> 
     <td>A widget which displays company's we proudly support</td> 
     <td width="80px"> 
      <input type="hidden" class="hiddenData" name="" value="2" /> 
      <a href="" title="Up" class="upArrow arrowButtons"></a> 
      <a href="" title="Down" class="downArrow arrowButtons"></a> 
     </td> 
    </tr> 
</table> 

而jQuery是如下:

$(".arrowButtons").live('click', function(e) { 
    e.preventDefault(); 
}); 

$(".upArrow").live('click', function(e) { 
    var element = $(this).parent().parent(); 

    if(element.prev().html() != null) 
    { 
     var elementContents = element.html(); 

     $("<tr>"+elementContents+"</tr>").insertBefore(element.prev()); 
     element.remove(); 
    } 
}); 

上爲什麼(c)任何想法會發生嗎?

+0

刪除ui.checkbox.js修復了這個問題,但我需要它來保證某些樣式。 :/ – Skippy 2010-10-25 08:34:53

+0

我總是避免使用jQuery UI – andho 2010-10-25 08:37:58

+0

任何具體原因爲什麼? – Skippy 2010-10-25 08:54:25

回答

1

我剛剛註釋掉了導致ui.checkbox.js中的問題的行,它正在工作。會做適當的測試,但到目前爲止,一切似乎都奏效。

+0

您是否向jQuery支持或補丁或其他內容報告過? – andho 2010-10-26 10:49:01

相關問題