首页 > 解决方案 > How to use checkbox in editableCellTemplate?

问题描述

Please look at the following code:

            {
                name: 'روش محاسبه',
                field: 'feeType',
                enableCellEdit: true,
                editableCellTemplate: 'ui-grid/dropdownEditor',
                editDropdownValueLabel: 'feeType',
                editDropdownIdLabel: 'feeType',
                width: '*'
            },

How can I use checkbox instead of dropdown? Thanks.

标签: angularjscheckbox

解决方案


You need to create your own html file template and then you can add checkbox in the template. You can find available html ui-grid edit feature templates at https://github.com/angular-ui/ui-grid/tree/master/packages/edit/src/templates

Example:

<div class="ui-grid-cell-edit-contents">
  <input type="checkbox" data-ng-model="MODEL_COL_FIELD" />
</div>

推荐阅读