<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<ej:Grid ID="OrdersGrid" runat="server" ClientIDMode="Static" AllowPaging="True" >
<ClientSideEvents RecordClick="recordClick" />
<Columns>
<ej:Column Type="checkbox" Width="90"></ej:Column>
..
</ej:Grid>
</ContentTemplate>
</asp:UpdatePanel>
<script type="text/javascript">
function recordClick(args) {
var index = this.model.pageSettings.currentPage - 1;
if (!($(args.cell).hasClass("e-checkcell"))) {
if (ej.isNullOrUndefined(this.checkSelectedRowsIndexes[index]))
this.selectRows(args.rowIndex);
else if ($(args.row).attr("aria-selected")) { // Deselecting
$(args.row).removeAttr("aria-selected").find(".e-selectionbackground").removeClass("e-selectionbackground").removeClass("e-active");
var checkBoxIndex = $.inArray(args.rowIndex, this.checkSelectedRowsIndexes[index]);
this.checkSelectedRowsIndexes[index].splice(checkBoxIndex, 1);
$(args.row).find(".e-checkcelldiv [type=checkbox]").prop("checked", false);
}
else {
this.checkSelectedRowsIndexes[index].push(args.rowIndex);
this.selectRows(this.checkSelectedRowsIndexes[index]);
}
}
}
</script>
</asp:Content> |