The intention of this post is to explain about the Repository pattern and how it’s useful in enterprise applications. Introduction Why use Repository Misconceptions Implementation Conclusion Source Code Introduction The repository pattern is an abstraction layer between your database and…
ASP.NET CORE 2.2.1 Hosting – Kendo UI Grid With Select All Checkbox In Header
In this example, I will create a Kendo UI grid with multiple checkboxes and one checkbox in the header to check all the checkboxes inside the grid. Below is the Angular code to bind the grid.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
function bindGrid() { var filterContain = { cell: { showOperators: false, operator: "contains", suggestionOperator: "contains" } } var DataColumn = [ { title: "<input id='chkAll' class='checkAllCls' type='checkbox'/>", width: "35px", template: "<input type='checkbox' class='check-box-inner' />", filterable: false }, { field: "ID", title: "ID", width: "10%", filterable: filterContain }, { field: "First_Name", title: "First Name", width: "10%", filterable: filterContain }, { field: "Last_Name", title: "Last Name", width: "10%", filterable: filterContain }, { field: "EmailID", title: "Email ID", width: "10%", filterable: filterContain }, { field: "Mobile", title: "Mobile", width: "10%", filterable: filterContain }, ]; $("#grd").kendoGrid({ selectable: "multiple", dataSource: { schema: { model: { fields: { ID: { type: "string" }, First_Name: { type: "string" }, Last_Name: { type: "string" }, EmailID: { type: "string" }, Mobile: { type: "string" }, } } }, pageSize: 100, }, height: 800, filterable: { mode: "row" }, groupable: false, scrollable: true, pageable: true, sortable: true, columns: DataColumn, }); $("#grd tbody").on("click", "tr", function (e) { var rowElement = this; var row = $(rowElement); var grid = $("#grdC").getKendoGrid(); if (row.hasClass("k-state-selected")) { row.removeClass('k-state-selected'); row.find('[type=checkbox]').prop('checked', false); e.stopPropagation(); } else { grid.select(row) row.find('[type=checkbox]').prop('checked', true); e.stopPropagation(); } }); $(".checkAllCls").on("click", function () { var ele = this; var state = $(ele).is(':checked'); var grid = $('#grd').data('kendoGrid'); if (state == true) { $('.check-box-inner').prop('checked', true).closest('tr').addClass('k-state-selected'); } else { $('.check-box-inner').prop('checked', false).closest('tr').removeClass('k-state-selected'); } }); } |
HTML code where you…
ASP.NET CORE 2.2.1 Hosting – Overview Of CLR and Its Major Tasks In .NET
The Runtime Environment of .NET Framework is Called Common Language Runtime. CLR can be considered as Virtual Machine (VM) component of Microsoft’s .NET framework. It manages the execution of Managed Code (.NET Programs). CLR uses a just-in-time (JIT) compiler which converts…