Editor not a constructor

Editor not a constructor

coreywcoreyw Posts: 6Questions: 1Answers: 0

Hi All,

I'm trying out grafting DataTables Editor into an existing project that uses jQuery 1.10.2. I added the following scripts tags:

    <script src="~/Content/assets/js/jquery.js"></script>
    <script src="~/Scripts/libs/jquery.jeditable.js"></script>   // what I'm trying to move away from
    <script src="~/Scripts/libs/jquery.dataTables.js"></script>
    <script src="~/Scripts/libs/dataTables.editor.js"></script>

And the following code:

    var _editorObj = new $.fn.dataTable.Editor({
        ajax: { data: readings },
        table: _tableId,
        fields: [{
            label: "Reading",
            name: "FriendlyPropertyName"
        }]
    });

    _dataTableObj = $(_tableId).DataTable({
        data: readings,
        columns: [
            { data: "FriendlyPropertyName", render: renderPropertyColumn },
        ],
        order: [1, 'asc']
    });   

I verified that dataTables.editor.js is being loaded (FireBug). I've seen all sorts of posts about people using RequireJS, but that's not the case here. Could it be that because I have some <script> that is preventing the editor from loading itself into DataTables? Is there any way I can verify that Editor is being loaded properly?

Thanks for any help as I evaluate Editor.

Corey

Answers

  • coreywcoreyw Posts: 6Questions: 1Answers: 0

    Sorry, folks - I thought I posted this to the Editor forum... :P

  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin
    edited October 2014

    Hi Corey,

    Very odd! I don't see anything in the above code that would cause an issue, unless the constructor code is being run before the Editor JS is loaded.

    Are you able to send me a link to the page so I can take a look and see what is going on? You can e-mail me the address at allan @ this domain.net, if you don't want to make it public.

    Regards,
    Allan

This discussion has been closed.