When we use RenderCheckBox in datatable then we have to use Id as property to bind value because of then
in _Table.Definition.cshtml.
case RenderCheckBox checkBox:
<text>
render: function (data, type, row, meta) {
return (data === 'true')
? '<input name="@checkBox.Name" value="' + row.Id + '" type="checkbox" class="checkboxGroups" checked="checked" />'
: '<input name="@checkBox.Name" value="' + row.Id + '" type="checkbox" class="checkboxGroups" />';
},
</text>
break;
I think, it should not be limited to Id property.
We are unable to use another model property to bind values in checkboxes.
There should be another parameter pass from RenederCheckBox to use in row.PropertyName.
What do you think?