2012-03-01 94 views

回答

1

當我單擊添加(可用區域)時,其他連擊已嘗試重新加載,但它們失敗。

如果你想重新加載這些組合,你需要在它之前重新選擇容器風格和內容(div容器 - >刪除class jqTransformSelectWrapper並在選擇它之前刪除兩個子組件)。

我爲jqTransform做了一個函數。事情是這樣的:

$.fn.jqTransSelectReset = function() { 
    this.each(function() { 
     var item = $(this); 
     if (item.hasClass('jqTransformHidden')) { 
      item.removeClass('jqTransformHidden'); 
      $(item.parent().get(0)).removeAttr('style'); 
      $(item.parent().get(0)).removeAttr('class'); 
      $(item.parent().get(0, 'children').firstChild).remove(); // div 
      $(item.parent().get(0, 'children').firstChild).remove(); // ul 
     } 
    }); 
    // this class is just a flag - remove it 
    $('select').removeClass('jqTransformHidden'); 
    // re-run the transformation in all selects 
    return $('select').jqTransSelect(); 
}; 

然後加載您的組合框,並調用函數jqTransSelectReset這樣的:

$('#yourSelectToRefresh').load(...); // fake method to load combobox 
$('select').jqTransSelectReset(); 

希望它能幫助!

最好的問候。

記住:如果它可以幫助你,請投票! =)