I have load the multiple records from sql database table to JQuery Datatable.
I want to do that, to set focus in JQuery Datatable cell 1st row & 1st column after page load.
How will i do that???
Please help to me anybody.....
What I have tried:
$(document).ready(function () {
$("#demoGrid").DataTable({
processing: true, // for show progress bar
serverSide: true, // for process server side
filter: true, // this is for disable filter (search box)
orderMulti: false, // for disable multiple column at once
paging: false,
scrollY: 200,
keys: true,
ajax: {
url: "/Demo/LoadData",
type: "POST",
datatype: "json"
},
columnDefs:
[{
targets: [0],//companyID
visible: false,
searchable: false
},
{
targets: [2],//contactname
orderable: false
},
{
targets: [3],//contactTitle
orderable: false
},
{
targets: [4],//CIty
orderable: false
},
{
targets: [5],//PostalCode
orderable: false
},
{
targets: [6],//country
orderable: false
},
{
targets: [7],//phone
visible: false,
searchable: false,
orderable: false
},
],
columns: [
{ data: "CustomerID", name: "CustomerID", autoWidth: true },
{ data: "CompanyName", name: "CompanyName", autoWidth: true },
{ data: "ContactName", "title": "ContactName", name: "ContactName", autoWidth: true },
{ data: "ContactTitle", name: "ContactTitle", autoWidth: true },
{ data: "City", name: "City", autoWidth: true },
{ data: "PostalCode", name: "PostalCode", autoWidth: true },
{ data: "Country", name: "Country", autoWidth: true },
{ data: "Phone", name: "Phone", title: "Status", autoWidth: true},
]
});
});