Add check box in header column,check box in item column in grid server server-side processing
Add check box in header column,check box in item column in grid server server-side processing
suvro84
Posts: 6Questions: 0Answers: 0
$(document).ready(function () {
var oTable = $('#grid').dataTable({
'bPaginate': true,
"sAjaxSource": 'Home/GetAjaxData',
'sPaginationType': 'full_numbers',
'iDisplayLength': 5,
"aoColumns": [
{
"mData": "ID",
"bSearchable": false,
"bSortable": false,
"fnRender": function (oObj) {
var str = '';
return str;
}
},
{ "mData": "ID" },
{ "mData": "Name" },
{ "mData": "Address" },
{ "mData": "Town" }
]
// , "fnInitComplete": function () {
// new FixedColumns(oTable, {
// "iLeftColumns": 2,
// "iLeftWidth": 350
// });
// }
});
});
This is not workking..plz help
var oTable = $('#grid').dataTable({
'bPaginate': true,
"sAjaxSource": 'Home/GetAjaxData',
'sPaginationType': 'full_numbers',
'iDisplayLength': 5,
"aoColumns": [
{
"mData": "ID",
"bSearchable": false,
"bSortable": false,
"fnRender": function (oObj) {
var str = '';
return str;
}
},
{ "mData": "ID" },
{ "mData": "Name" },
{ "mData": "Address" },
{ "mData": "Town" }
]
// , "fnInitComplete": function () {
// new FixedColumns(oTable, {
// "iLeftColumns": 2,
// "iLeftWidth": 350
// });
// }
});
});
This is not workking..plz help
This discussion has been closed.
Replies
$(document).ready(function () {
var oTable = $('#grid').dataTable({
"sScrollY": "300px",
"sScrollX": "100%",
"sScrollXInner": "150%",
"bScrollCollapse": true,
"bProcessing": true,
"bServerSide": true,
'bPaginate': true,
'bFilter': false,
"sAjaxSource": 'Home/AjaxHandler',
'sPaginationType': 'full_numbers',
'iDisplayLength': 5,
"aoColumnDefs": [{
"aTargets": [0],
//"mData": "download_link",
"mRender": function (data, type, full) {
return '';
}
}
],
"aoColumns": [
{ "sName": "ID" },
{ "sName": "ID" },
{ "sName": "Name" },
{ "sName": "Address" },
{ "sName": "Town" }
]
, "fnInitComplete": function () {
new FixedColumns(oTable, {
"iLeftColumns": 2,
"iLeftWidth": 350
});
}
});
});
ID
Name
Address
Town
public JsonResult GetAjaxData(JQueryDataTableParamModel param)
{
var allCompanies = DataRepository.GetCompanies1();
return Json(new
{
aaData = allCompanies
},
JsonRequestBehavior.AllowGet);
}
public static IList GetCompanies1()
{
CompanyData = new List();
string cbs = string.Empty;
for (int i = 0; i < 3000; i++)
{
CompanyData.Add(new Company() { ID = i, Name = "Emkay Entertainments", Address = "Nobel House, Regent Centre", Town = "Lothian"});
});
}
return CompanyData;
}