2011-05-13 57 views
0

我們最近更新了jQuery從1.4.2到1.6.1,jQueryUI從1.8.4到1.8.12。在IE升級到1.6.1和jQueryUI後jQuery datepicker問題1.8.12

在我們的測試中,我們已經有一個除外沒有嚴重的問題:

我們有使用日期選擇器,並且在選擇一個新的日期更新的格式下拉菜單的自定義控制。現在,當你選擇一個日期,你會收到以下錯誤:

'length' is null or not an object 

WebResource.axd 

在此之前的升級,這在所有現代瀏覽器工作正常。自升級以來,我們的測試人員已停止在IE(64位機器運行Windows 7,IE 8,兼容模式無關緊要)工作。它似乎仍然在XP中工作。

A related question在09年被問及回到very good answer

我試過實現它,並打破了'更新dropdownlist'部分的功能。

控制是通過調用這個函數,傳遞控制爲$範圍初始化:

function InitializeCalendarDateControl($scope) { 
CalendarDateControl_FirstTimeThrough = true; 

$("input.date", $scope).datepicker({ changeMonth: true, changeYear: true, yearRange: '1850:c+5'}); 

var groupedControls = $("div.CalendarDateControlCssClass[groupname!=]", $scope); 


    --snip some control hiding stuff 
    --snip some time format validation stuff 


if (!$scope.hasClass("CalendarDateControlCssClass")) { 
    $("input.hasDatepicker, input.hh, input.mm, select.dates, select.ampm", $scope).live("change", function() { 
     CalendarDateControl_FirstTimeThrough = false; 
     updateControls($(this)); 
    }); 

    if (groupedControls.length > 0) { 
     $("div.CalendarDateControlCssClass", $scope).each(function() { 
      updateControls($(this).children("input:eq(0)")); 
     }); 
    } 
} else { 
    $("input.hasDatepicker, input.hh, input.mm, select.dates, select.ampm", $scope).live("change", function() { 
     CalendarDateControl_FirstTimeThrough = false; 
     updateControls($(this)); 
    }); 
    if (groupedControls.length > 0) { 
     updateControls($scope.children("input:eq(0)")); 
    } 
} 
} 

的updateControls功能是更新下拉列表中選擇功能。

使用上述答案中鏈接的修復程序,更改事件似乎不會觸發。

我能做些什麼來解決這個問題?

回答

2

就我個人而言,我現在會升級到1.5.2,因爲在1.6+中可能會有一些潛在的中斷更改