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

suvro84suvro84 Posts: 6Questions: 0Answers: 0
edited September 2013 in DataTables 1.9
$(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

Replies

  • suvro84suvro84 Posts: 6Questions: 0Answers: 0
    it is giving error as JavaScript runtime error: Unable to get property 'style' of undefined or null reference
  • suvro84suvro84 Posts: 6Questions: 0Answers: 0
    I want to have check box in first column of my grid with fixed columns.The grid will have select all check box in the header column.I am repeatedly failing to get a solution plz help!!

    $(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;
    }
This discussion has been closed.