We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Get Row.Record of Checkbox Template by Javascript

Hi Syncfusion team!
I'm using RowBtnTemplate with Checkbox template in GridGroupingControl. Pls show me how can I get Record["mycolumnName"] of Checkbox.Cell.Row in javascript?
  <script type="text/javascript">
        function CheckAll(oData) {
            if ((oData.id.indexOf("header") != -1)) {
                var CheckBoxId = oData.id;
                var getElement = document.getElementsByTagName("input");
                for (var i = 0; i < getElement.length; i++) {
                    //Checks if the currentelement is a row
                    if ((getElement[i].id.indexOf("GridGroupingControl1~TR~0~_TOPGROUP_") != -1)) {
                        var currentCheckBoxId = getElement[i].id;

                        //get the id of the current checkbox              
                        if (document.getElementById(CheckBoxId).checked == true) {
                            document.getElementById(currentCheckBoxId).checked = true;
                        }
                        else {
                            document.getElementById(currentCheckBoxId).checked = false;
                        }
                    }
                }
            }
            else {
                var CheckBoxId = oData.id;
                var getElement = document.getElementsByTagName("input");
                for (var i = 0; i < getElement.length; i++) {
                    //Checks if the currentelement is a row
                    if ((getElement[i].id.indexOf("GridGroupingControl1~TR~0~_TOPGROUP_") != -1)) {
                        var currentCheckBoxId = getElement[i].id;                     
                        //if oData.Cell.Row.Record.GetValue("ID") == getElement[i].Cell.Row.Record.GetValue("ParentID")??????????????
                        if (document.getElementById(CheckBoxId).checked == true) {
                            document.getElementById(currentCheckBoxId).checked = true;
                        }
                        else {
                            document.getElementById(currentCheckBoxId).checked = false;
                        }

                    }
                }
            }
        }
    </script>

Thank you very much.

1 Reply

SK Shanmugaraja K Syncfusion Team October 17, 2013 12:58 PM UTC

Hi Ngatq,

Thanks for using syncfusion products.

We regret for the inconvenience caused.your requirement of get row record of checkbox template by javascript it is not possible on client side it takes only gridtable rows  didnot take table cells.so, we can't retrive row record in javascript.
Please let us know your concerns.

Regards,
Shanmugaraja K



checkboxaspgrid_3d0896d6.zip

Loader.
Live Chat Icon For mobile
Up arrow icon