This question is locked. New answers and comments are not allowed.
I cannot get the grid to clear or check the checkboxes. The line below no worko. Any ideas?
$('checkedRecords').removeAttr("CHECKED");
checkAll checkbox above grid and grid column to check/uncheck
<div id="divClaimGrid" style="padding-left: 3px;">
<span><input id='checkAll' type='checkbox' checked="true"/> Check All</span>
@(Html.Telerik().Grid<SAM.Framework.Utilities.CloneClasses.vxClaimBO>(Model.VXClaimBOs).Name("ClaimsGrid")
.Columns(columns =>
{
columns.Bound(column => column.ClaimID)
.Template(@<text><input type='checkbox' name='checkedRecords' value='@item.ClaimID' checked="checked" /></text>)
.Title("").Width(36).HtmlAttributes(new { style = "text-align:center" })
.ClientTemplate("<input type='checkbox' name='checkedRecords' checked='checked' value='<#= ClaimID #>'")
.Sortable(false)
.Filterable(false);
columns.Bound(column => column.ClaimNo).Width(65).Title("Claim No")
blah... blah...rest of grid
Script on page:
$(document).ready(function () {
$('#checkAll').click(function () {
debugger;
if (this.checked)
$("#ClaimsGrid > tbody > input:checkbox").attr("checked", "checked");
else {
//$("#ClaimsGrid > tbody > input:checkbox").removeAttr("CHECKED");
$('checkedRecords').removeAttr("CHECKED");
}
});
});
$('checkedRecords').removeAttr("CHECKED");
checkAll checkbox above grid and grid column to check/uncheck
<div id="divClaimGrid" style="padding-left: 3px;">
<span><input id='checkAll' type='checkbox' checked="true"/> Check All</span>
@(Html.Telerik().Grid<SAM.Framework.Utilities.CloneClasses.vxClaimBO>(Model.VXClaimBOs).Name("ClaimsGrid")
.Columns(columns =>
{
columns.Bound(column => column.ClaimID)
.Template(@<text><input type='checkbox' name='checkedRecords' value='@item.ClaimID' checked="checked" /></text>)
.Title("").Width(36).HtmlAttributes(new { style = "text-align:center" })
.ClientTemplate("<input type='checkbox' name='checkedRecords' checked='checked' value='<#= ClaimID #>'")
.Sortable(false)
.Filterable(false);
columns.Bound(column => column.ClaimNo).Width(65).Title("Claim No")
blah... blah...rest of grid
Script on page:
$('#checkAll').click(function () {
debugger;
if (this.checked)
$("#ClaimsGrid > tbody > input:checkbox").attr("checked", "checked");
else {
//$("#ClaimsGrid > tbody > input:checkbox").removeAttr("CHECKED");
$('checkedRecords').removeAttr("CHECKED");
}
});
});