Wednesday, 18 September 2013

telerik MVC Grid with check all checkbox not functioning

telerik MVC Grid with check all checkbox not functioning

I know my code is right but am I missing a scripts? i'm using
jquery-1.7.1.min.js
@(Html.Telerik().Grid<RenanNewTask.Models.RenanListViewModel>()
.Name("RenanGrid")
.DataKeys(dataKeys => dataKeys.Add(c => c.Org_UID))
.Columns(columns =>
{
//columns.Bound(c => c.eff_date).Title("Effective
Date").Format("{0:MM/dd /yyyy}").Width(20);
columns.Bound(c => c.eff_date).Title("Effective
Date").ReadOnly(true).Format("{0:MM/dd/yyyy}").Width(20).Encoded(true)
.ClientTemplate("<input type='checkbox' name='checkedRecords'
value='<#= eff_date #>' />")
.HeaderTemplate(
@<text>
<input type="checkbox" title="check all records"
id="checkAllRecords" />
</text>
)
.Title("")
.Width(10)
.HeaderHtmlAttributes(new { style = "text-align:center" })
.HtmlAttributes(new { style = "text-align:center" });
columns.Bound(o => o.eff_date).Width(20);
columns.Bound(c => c.name_long).Title("Name Long").Width(20);
})
.DataBinding(dataBinding => dataBinding.Ajax()
.Select("GetOrgUID", "Renan"))
.Pageable(paging => paging.Style((GridPagerStyles.PageInput |
GridPagerStyles.Numeric | GridPagerStyles.PageSizeDropDown |
GridPagerStyles.NextPrevious)).Position(GridPagerPosition.Bottom).PageTo(1).PageSize(20))
.Scrollable(scrolling => scrolling.Height(250))
.Resizable(resizing => resizing.Columns(true))
)
$('#checkAllRecords').click(function checkAll() { $("#RenanGrid tbody
input:checkbox").attr("checked", this.checked); });

No comments:

Post a Comment