Error when using hide empty columns plugin

Error when using hide empty columns plugin

justusdjjustusdj Posts: 1Questions: 1Answers: 0
edited October 2018 in Free community support

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

Answers

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    Answer ✓

    You need to check what is being returned by your "data:" parameter. It looks as if it might be HTML rather than JSON.

This discussion has been closed.