Disabling specific cell edit in Slick grid

寵の児 提交于 2019-12-03 23:16:37
grid.onBeforeEditCell.subscribe(function(e,args) {
  if (!isCellEditable(args.row, args.cell, args.item)) {
    return false;
  }
});

You can disable or even change editor/formatter/validator... or other cell properties using getItemMetadata method. There is very nice documentation for this here.
Example:

$scope.data.data.getItemMetadata = function (row) {
  var item = $scope.data.data.getItem(row);
  if (item.some_condition) {
    return {
      columns : {
        yourColumnId : {
          editor : null,
          formatter : function () { return 'custom formater if some_condition'; }
        }
      }
    };
  }
};
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!