Category / Section
How to hide detail button for some rows
4 mins read
In TreeGrid, it is possible to hide the detail button for some rows by using rowDataBound and detailsShown event. The rowDataBound event will be triggered while rendering each row and the detailsShown event will be triggered when details template pop-up is shown in TreeGrid.
HTML
<script type="text/javascript"> $(function () { $("#TreeGridContainer").ejTreeGrid({ //.. rowDataBound: "rowDataBound", detailsShown: "detailsShown", }); }); function rowDataBound(args) { if (employee.indexOf(args.data.EmployeeID) != -1) args.rowElement.find(".e-detailsrowcell").text(""); } function detailsShown(args) { if (employee.indexOf(args.data.EmployeeID) != -1) args.cancel = true; } </script>
A simple sample to hide the detail button for some rows is available here