pinnable.isRowPinnableFunction

A function that determines whether a specific row can be pinned. The function receives an object with a dataItem field containing the data item for the row, and must return a boolean value. When the function returns false for a row, the pin column renders an empty cell without a pin icon, the pin column context menu does not open for that row, and the pinRows method does not pin the row. Unpinning is always allowed regardless of this function's return value.

Example - allow pinning only for rows with age greater than 30

<div id="grid"></div>
<script>
$("#grid").kendoGrid({
  columns: [
    { pinnable: true, width: 40 },
    { field: "name" },
    { field: "age" }
  ],
  dataSource: {
    data: [
      { id: 1, name: "Jane Doe", age: 30 },
      { id: 2, name: "John Doe", age: 33 },
      { id: 3, name: "Jim Doe", age: 25 }
    ],
    schema: {
      model: { id: "id" }
    }
  },
  pinnable: {
    isRowPinnable: function(context) {
      return context.dataItem.age > 30;
    }
  }
});
</script>

Example - combine isRowPinnable with pinRowLocation

<div id="grid"></div>
<script>
$("#grid").kendoGrid({
  columns: [
    { pinnable: true, width: 40 },
    { field: "name" },
    { field: "age" }
  ],
  dataSource: {
    data: [
      { id: 1, name: "Jane Doe", age: 30 },
      { id: 2, name: "John Doe", age: 33 },
      { id: 3, name: "Jim Doe", age: 25 }
    ],
    schema: {
      model: { id: "id" }
    }
  },
  pinnable: {
    pinRowLocation: "top",
    isRowPinnable: function(context) {
      return context.dataItem.age > 30;
    }
  }
});
</script>
In this article
pinnable.isRowPinnable
Not finding the help you need?
Contact Support