Skip to content

Commit

Permalink
nopSolutions#3998 RenderCheckbox values should not be limited to Id p…
Browse files Browse the repository at this point in the history
…roperty
  • Loading branch information
DmitriyKulagin committed Sep 5, 2019
1 parent fb5f157 commit 0cd0579
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ public partial class RenderCheckBox : IRender
/// Initializes a new instance of the RenderCheckBox class
/// </summary>
/// <param name="name">Checkbox name</param>
public RenderCheckBox(string name)
/// <param name="propertyKeyName">Property key name ("Id" by default). This property must be defined in the row dataset.</param>
public RenderCheckBox(string name, string propertyKeyName = "Id")
{
Name = name;
PropertyKeyName = propertyKeyName;
}

#endregion
Expand All @@ -25,6 +27,11 @@ public RenderCheckBox(string name)
/// </summary>
public string Name { get; set; }

/// <summary>
/// Gets or sets identificator for row
/// </summary>
public string PropertyKeyName { get; set; }

#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ columns: [
<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" />';
? '<input name="@checkBox.Name" value="' + row.@checkBox.PropertyKeyName + '" type="checkbox" class="checkboxGroups" checked="checked" />'
: '<input name="@checkBox.Name" value="' + row.@checkBox.PropertyKeyName + '" type="checkbox" class="checkboxGroups" />';
},
</text>
break;
Expand Down

0 comments on commit 0cd0579

Please sign in to comment.