Edição condicional da grade da interface do usuário do Kendo
Gostaria de desativar as colunas DiscountPercentageMRC / NRC / Usage para determinadas CatalogProductId. Encontre abaixo o javascript da grade. Qualquer ajuda seria muito apreciada.
<h2>Kendo Grid bound to ASP.NET MVC action methods</h2>
@* The DIV where the Kendo grid will be initialized *@
<div id="grid"></div>
<script>
$(document).ready(function () {
$("#grid").kendoGrid({
columns: [
{ field: "CompanyId"},
{ field: "CompanyName" },
{ field: "DiscountPercentageMRC" },
{ field: "CatalogProductId"},
{ field: "DiscountPercentageMRC" },
{ field: "DiscountPercentageNRC" },
{ field: "DiscountPercentageNRC" },
{ field: "DiscountPercentageUsage"}
],
height: 400,
editable: true, // enable editing
pageable: true,
sortable: true,
filterable: true,
toolbar: ["create", "save", "cancel","edit"], // specify toolbar commands
dataSource: {
serverPaging: true,
serverFiltering: true,
serverSorting: true,
pageSize: 10,
batch: true,
editable: "inline",
transport: {
read: {
url: "@Url.Action("ResellerDiscountsGet", "AccountDetail", new { BusOrdId = @ViewBag.Message })",
type: "POST",
}
}
},
selectable: true
});
});
</script>