Reputation: 243
I want to hide kendo grid command edit button or delete button based on role. + How to hide command column if needed.Thanks
{ command: [{ name: "Details", click: showDetails },
{ name: "Edit", click: onEdit },
{ name: "Delete", click: obDelete, hidden:true}], title: 'Actions', width: 230 }
Upvotes: 2
Views: 14978
Reputation: 124
Just in case, if someone needs an answer (Reference: http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.command.visible)
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "name" },
{ command: [{ name: "edit", visible: function(dataItem) { return
dataItem.name==="Jane" } }] }
],
editable: "popup",
dataSource: [ { name: "Jane" }, { name: "Bill" } ]
});
</script>
Upvotes: 4