Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
145551 | Jun 27,2019 05:08 PM UTC | Dec 4,2020 04:57 PM UTC | ASP.NET MVC - EJ 2 | 5 |
![]() |
Tags: Grid |
[Index.cshtml]
@Html.EJS()...DataBound("DataBound").AllowGrouping().GroupSettings(group => { group.CaptionTemplate("#captiontemplate"); }).Render()
<script id="captiontemplate" type="text/x-template">
${field} - ${key} <input id="CheckboxGrid" class="groupcheck" type="checkbox" />
</script>
<script type="text/javascript">
function DataBound(args) {
var chaecksavil = document.getElementsByClassName("groupcheck");
if (chaecksavil.length) {
for (var i = 0; i < chaecksavil.length; i++) {
var checkBoxObj = new ej.buttons.CheckBox({ change: onChange });
checkBoxObj.appendTo(chaecksavil[i]); //Render Syncfusion checkbox component in group caption
}
}
}
function onChange(args) {
var obj = document.getElementsByClassName("e-grid")[0].ej2_instances[0]
var tr = ej.grids.parentsUntil(args.event.target, 'e-groupcaption').parentElement;
let i = tr.rowIndex;
let nextRow;
let indexes = [];
i++;
nextRow = tr.parentElement.rows[i];
while (nextRow.classList.contains('e-row')) { //Perform select/de-select here
if (args.checked && (obj.getSelectedRowIndexes().indexOf(parseInt(nextRow.getAttribute('aria-rowindex'))) > -1)) {
nextRow.getElementsByTagName('input')[0].click()
}
nextRow.getElementsByTagName('input')[0].click()
i++;
nextRow = tr.parentElement.rows[i];
}
}
</script>
|
Hi Can Gunaydin,
Please find the angular grid component sample implemented with the same behavior below,
Let us know if you have any concerns.
Regards,Sujith R
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.