用仅图标替换Kendogrid命令按钮

时间:2018-07-09 13:12:28

标签: angularjs kendo-grid

我在kendogrid中有编辑和删除按钮,我只想为它们添加一些不同的图标。 我尝试了几种方法,例如:

command:
          [
            { name: 'edit', text: { edit: ' ', update: ' ', cancel: '' } },
            { name: 'destroy', text: ' ' , template: '<a href=""><span class="delete_icon"></span></a>' }
          ]


 .k-grid-edit {
    background-color: transparent !important;
    border: medium none !important;
    margin: 0 !important;
    min-width: 0 !important;
}

在这种情况下,我可以看到删除按钮的新图标。 但是现在如何更改图标以进行编辑,更新和取消按钮?

我无法使用模板作为“编辑”按钮。为什么那不可能呢?

1 个答案:

答案 0 :(得分:0)

我想我对您的其他问题的answer在这里也适用。您可以为编辑和删除按钮使用超棒的字体图标,但仍绑定到内置函数。

{"command": [
    {
      "text": "Edit",
      "template": "<a role='button' class='k-button k-button-icontext k-grid-edit'><span class='far fa-edit'></span></a>"
    },
    {
      "text": "Delete",
      "template": "<a role='button' class='k-button k-button-icontext k-grid-delete'><span class='far fa-trash-alt'></span></a>"
    }
  ]
}

正如我在上一个答案中提到的那样,将按钮绑定到内置函数的魔力在类k-grid-deletek-grid-edit

这里是example that uses custom icons