Breaking

Search Here

31 October 2014

Grid View Header check box and Child Check box Checking Unchecking functionality using Jquery



<script>
$(document).ready(function () {

$('#gridviewid').find('input:checkbox[id$="headercheckbox"]').click(function () {

var isChecked = $(this).prop("checked");

$("#gridviewid[id*=childcheckbox]:checkbox").prop('checked', isChecked);

});

$('#gridviewid').find('input:checkbox[id$="childcheckbox"]').click(function () {

var flag = true;

$("#gridviewid[id*=childcheckbox]:checkbox").each(function () {

if ($(this).prop("checked") == false)

flag = false;

});

$("#gridviewid[id*=headercheckbox]:checkbox").prop('checked', flag);

});

</script>

No comments:

Post a Comment

Hello all, if you have any doubt feel free comment

Comments