답변

1

JS와 함께하는 방법은 다음과 같습니다.

그리드 :

당신이 할 필요가 (당신이 창에 대한 일반 JS을 사용해야 할 수도 있지만 당신이) 이벤트를 클릭 jQuery를 사용하려는 경우 ( Html.Kendo().Grid(), @(Html.Kendo().Tooltip()Html.Kendo().Window()) 적절한 MVC 래퍼를 사용하는 것입니다
var grid = $("#grid").kendoGrid({ 
    dataSource: dataSource, 
    columns: [{ 
     field: "Id", 
     title: "Id", 
     filterable: false 
    }, { 
     field: "StatusText", 
     title: "String value" 
    }, { 
     field: "ToolTip", 
     title: "Tool tip column", 
     template: "<span class='tooltip'>#= data.ToolTip #</span>" 
    }] 
}).data("kendoGrid"); 

도움말 :

var currentDataItem; 
var toolTip = $('#grid').kendoTooltip({ 
    filter: ".tooltip", 
    content: function (e) { 
     var row = $(e.target).closest("tr"); 
     currentDataItem = grid.dataItem(row); 
     return "<div>Hi, this is a tool tip for id " + currentDataItem.Id + "! <br/> <button class='open'>Open window</button></div>"; 
    } 
}).data("kendoTooltip"); 

창 :

$(document).on("click", ".open", function() { 
    var currentContent = currentDataItem.get("StatusText"); 
    $("<div>Current status: " + currentContent + "</div>").kendoWindow({ 
     modal: true 
    }).getKendoWindow().center().open(); 
}); 

(demo)

+0

열기 버튼을 클릭하면 창에 행 정보를 표시 할 수 있습니까? 창에 그리드의 같은 행 (예 : "some text")에 "문자열 값"이 표시 될 수 있습니까? – Sarly

+0

; 보시다시피 현재 툴팁의 컨텐트 메서드에서 현재 행의 모델에 액세스하고 있습니다. 윈도우를 설정하는 함수에 액세스 할 수있는 변수에 해당 모델을 저장하면됩니다 (데모에서는 전역 변수 여야합니다). 나는 그것을 반영하기 위해 해답을 편집했다. –