admin管理员组

文章数量:1325236

I want to hide kendo grid mand edit button or delete button based on role. + How to hide mand column if needed.Thanks

 { mand: [{ name: "Details", click: showDetails },
             { name: "Edit", click: onEdit },
             { name: "Delete", click: obDelete, hidden:true}], title: 'Actions', width: 230 }

I want to hide kendo grid mand edit button or delete button based on role. + How to hide mand column if needed.Thanks

 { mand: [{ name: "Details", click: showDetails },
             { name: "Edit", click: onEdit },
             { name: "Delete", click: obDelete, hidden:true}], title: 'Actions', width: 230 }
Share Improve this question asked Feb 25, 2015 at 19:15 IronmanIronman 2431 gold badge4 silver badges16 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 4

Just in case, if someone needs an answer (Reference: http://docs.telerik./kendo-ui/api/javascript/ui/grid#configuration-columns.mand.visible)

<div id="grid"></div>
<script>
$("#grid").kendoGrid({
  columns: [
    { field: "name" },
    { mand: [{ name: "edit", visible: function(dataItem) { return 
dataItem.name==="Jane" } }] }
  ],
  editable: "popup",
  dataSource: [ { name: "Jane" }, { name: "Bill" } ]
});
</script>

本文标签: javascriptHow to hide kendo grid command edit button or delete buttonStack Overflow