2016-10-12 3 views
0
@(Html.Kendo().Grid<Tracker.TMS.BE.uspTMSSelectAreas_Result>() 
    .Name("AvailableAreas") 
    .Groupable() 
    .Sortable() 
    .Filterable() 
    .Scrollable() 
    .Selectable(s => s.Mode(GridSelectionMode.Multiple)) 
    .Columns(columns => 
    { 
     columns.Bound(e => e.CustomerVehicleID).Visible(false); 
     columns.Bound(e => e.AreaID).Visible(false); 
     columns.Bound(e => e.AreaType).Title("Area Type").Width(100); 
     columns.Bound(e => e.SubType).Title("Sub Type").Width(100); 
     columns.Bound(e => e.AreaName).Title("Area Name"); 
    }) 
    .Resizable(resize => resize.Columns(true)) 
    .Pageable(page => page.Enabled(false)).NoRecords("No records found.") 
    .Events(e => e.Change("availableAreaSelected")) 
    .DataSource(dataSource => dataSource 
     .Ajax() 
     .Read(read => read.Action("GetAvailableAreas", "Vehicle").Data("filterAreas")))) 

答えて

2

グリッド列のサイズ変更が剣道UIバージョン2016.2.607にIEで動作しないChromeとFirefoxで正常に動作しないサイズ変更可能な剣道UIグリッド。ボディズームは、その後、1に設定されている場合で、すなわち以来@ dimodiの答えに

http://dojo.telerik.com/AzaKu/2

kendo.ui.Grid.fn._positionColumnResizeHandle = function() { 

    function cursor(context, value) { 
     $('th, th .k-grid-filter, th .k-link', context) 
     .add(document.body) 
     .css('cursor', value); 
    } 

    var NS = ".kendoGrid", 
     that = this, 
     isRtl = kendo.support.isRtl(that.element), 
     indicatorWidth = that.options.columnResizeHandleWidth, 
     lockedHead = that.lockedHeader ? that.lockedHeader.find("thead:first") : $(); 

    that.thead.add(lockedHead).on("mousemove" + NS, "th", function(e) { 
     var th = $(this); 

     if (th.hasClass("k-group-cell") || th.hasClass("k-hierarchy-cell")) { 
     return; 
     } 

     function getPageZoomStyle() { 
     var docZoom = parseFloat($(document.documentElement).css("zoom")); 
     if (isNaN(docZoom)) { 
      docZoom = 1; 
     } 
     var bodyZoom = parseFloat($(document.body).css("zoom")); 
     if (isNaN(bodyZoom)) { 
      bodyZoom = 1; 
     } 
     return docZoom * bodyZoom; 
     } 

     var clientX = e.clientX/getPageZoomStyle(), 
      winScrollLeft = $(window).scrollLeft(), 
      position = th.offset().left + (!isRtl ? this.offsetWidth : 0); 

     if (clientX + winScrollLeft > position - indicatorWidth && clientX + winScrollLeft < position + indicatorWidth) { 
     that._createResizeHandle(th.closest("div"), th); 
     } else if (that.resizeHandle) { 
     that.resizeHandle.hide(); 
     } else { 
     cursor(that.wrapper, ""); 
     } 
    }); 
    } 
+1

獣のように働いた! – Majase

+0

良い、私は助けてうれしいです。ケースが「閉鎖」されるように、回答として回答を記入してください。 – dimodi

1

若干の変更:クライアント側のグリッドオブジェクトのプロトタイプをオーバーライドする別のバージョン、または次の回避策を使用してください。

$(document.body).css("zoom") 

100%に戻り、ない1は、これは

kendo.ui.Grid.fn._positionColumnResizeHandle = function() { 

function cursor(context, value) { 
    $('th, th .k-grid-filter, th .k-link', context) 
    .add(document.body) 
    .css('cursor', value); 
} 

var NS = ".kendoGrid", 
    that = this, 
    isRtl = kendo.support.isRtl(that.element), 
    indicatorWidth = that.options.columnResizeHandleWidth, 
    lockedHead = that.lockedHeader ? that.lockedHeader.find("thead:first") : $(); 

that.thead.add(lockedHead).on("mousemove" + NS, "th", function(e) { 
    var th = $(this); 

    if (th.hasClass("k-group-cell") || th.hasClass("k-hierarchy-cell")) { 
    return; 
    } 

    function getPageZoomStyle() { 
    var docZoom = parseFloat($(document.documentElement).css("zoom")); 
    if (isNaN(docZoom)) { 
     docZoom = 1; 
    } 
    var bodyZoom = parseFloat($(document.body).css("zoom")); 
    if (isNaN(bodyZoom)) { 
     bodyZoom = 1; 
    } 
    else if (bodyZoom>=100 && (browser.msie || browser.edge)) { 
     bodyZoom = bodyZoom/100; 
    } 
    return docZoom * bodyZoom; 
    } 

    var clientX = e.clientX/getPageZoomStyle(), 
     winScrollLeft = $(window).scrollLeft(), 
     position = th.offset().left + (!isRtl ? this.offsetWidth : 0); 

    if (clientX + winScrollLeft > position - indicatorWidth && clientX + winScrollLeft < position + indicatorWidth) { 
    that._createResizeHandle(th.closest("div"), th); 
    } else if (that.resizeHandle) { 
    that.resizeHandle.hide(); 
    } else { 
    cursor(that.wrapper, ""); 
    } 
}); 
のサイズを変更からユーザーを防止します

}

関連する問題