Error when using hide empty columns plugin
Error when using hide empty columns plugin
justusdj
Posts: 1Questions: 1Answers: 0
Hi,
Thanks for making this plugin!
I pulled the js file from Github, but I'm getting an error "Uncaught SyntaxError: Unexpected token <" when trying to us it. Any ideas?
$('#TPMasterDetails').dataTable({
data: @(Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model.TradePartnerData))),
ordering: true,
paging: false,
fixedColumns: true,
fixedColumns: { leftColumns: 4 },
scrollY: "600px",
scrollX: true,
scrollCollapse: true,
order: [[1, "asc"]],
hideEmptyCols: ['VendorInvoiceAccount', 'VendorAccount'],
columns: [
{ data: "ID", render: edit_link },
{ data: "TPName" },
{ data: "TopLevelParent" },
{ data: "NextLevelParent" },
{ data: "ApplicationCode" },
{ data: "ItemPrependLabel" },
{ data: "CustomerAccount" },
{ data: "Override", render: simple_checkbox },
{ data: "SenderCode" },
{ data: "ShipToDepartment" },
{ data: "DropShipAccount" },
{ data: "VendorInvoiceAccount" },
{ data: "VendorAccount" },
{ data: "DefaultVendor" },
{ data: "ShipToVendor" }
]
});
Thanks,
-Dan
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You need to check what is being returned by your "data:" parameter. It looks as if it might be HTML rather than JSON.