Read values from Data Table row when checkbox is checked

Read values from Data Table row when checkbox is checked

tarun25tarun25 Posts: 3Questions: 2Answers: 0

I have a Data table where data binded from database through web services and ajax.I have created a column that have checkbox for each individual row.When I clicked on checkbox ,that selected row values has to fetched through based on checkbox Id[(In back end I have given checkbox column as ID with identity (1,1).]. Now I want to save that generated CheckBox ID in hiddenfield.

PLEASE GIVE ME SUGGESTIONS I AM NEW TO JQUERY,HERE MY CODE

    $(document).ready(function () {


        $('#example').dataTable({


            "ajax": 'serviceprovider.asmx/getdetails',


            "columns": [
              {

                  "targets": 0,
                  "data": null,
                  "defaultContent": '<input id="Checkbox1" type="checkbox" />'
              },
                 { "mDataProp": "FirstName" },
                 { "mDataProp": "LastName" },
                 { "mDataProp": "salary" },
                 { "mDataProp": "age" },
                 ],


            "ColumnDefs": [
             {
                 "fnRender": function (o) {
                     return '<input type= "hidden" id="hdnempid" value = ' + o.aData[o.oSettings.aoColumns[0].mDataProp] + ' />';
                          },

                 "Targets": [0]
                        }
                         ]


        });
    });
FirstName LastName salary age

Answers

This discussion has been closed.