Dynamic Column using handler
Dynamic Column using handler
neerajkumarmodi
Posts: 1Questions: 1Answers: 0
Hi,
Can somebody help me to modify the code so that i don't have to specify column name in my script & Html Table and whatever is returned by my handler(EmployeeDataHandler.ashx) is bind to table.
<link href="Content/DataTables/css/jquery.dataTables.min.css" rel="stylesheet" />
<script type="text/javascript">
$(document).ready(function () {
$('#datatable').DataTable(
{
columns: [
{ 'data': 'Id' },
{ 'data': 'FirstName' },
{ 'data': 'LastName' },
{ 'data': 'Gender' },
{ 'data': 'JobTitle' },
],
bServerSide: true,
sAjaxSource: 'EmployeeDataHandler.ashx'
}
);
});
</script>
Id | First Name | Last Name | Gender | Job Title |
---|
This discussion has been closed.