2016-10-05 5 views

答えて

1

あなたがあなたのグリッド列を設定するには、MVC流体のAPIを使用している場合は、このコード

function onDataBound() { 
//Selects all edit buttons 
$("#Grid tbody tr .k-grid-edit").each(function() { 
    var currentDataItem = $("#Grid").data("kendoGrid").dataItem($(this).closest("tr")); 

    //Check in the current dataItem if the row is editable 
    if (currentDataItem.isEditable == true) { 
     $(this).remove(); 
    }  
}) 
0

てみてください、あなたの条件

に基づく剣道グリッドのすべての行の[編集]ボタンを削除することができますこのソリューションを試してください。

columns.Bound(p => p.MyModelID).Title("My Button Column").Sortable(false) 
    .Width(120) 
    .ClientTemplate("#if(MyModelFieldShowButton){#" + 
     "<button onclick='myButtonClick(#=MyModelID#)' tabindex='0' class='k-button k-button-icontext' id='btnMy#=MyModelID#' role='button' aria-disabled='false' type='button' data-role='button'><span class='k-icon k-i-redo'></span>My Button Text</button>" + 
     "#}else{#" + 
     "<button onclick='myButtonClick(#=MyModelID#)' tabindex='0' class='k-button k-button-icontext' id='btnMy#=MyModelID#' role='button' aria-disabled='false' type='button' data-role='button' disabled><span class='k-icon k-i-redo'></span>My Button Text</button>" + 
     "#}#" 
    ) 
    .HeaderHtmlAttributes(new { title = "Queue the notification for delivery.", style = "text-align:center" } 
); 
関連する問題