DataTables Editor With Meteor

DataTables Editor With Meteor

rhsu0268rhsu0268 Posts: 5Questions: 1Answers: 0

I want to use the Datatables Editor with the Meteor Framework.

I am doing:

var editor = new $.fn.dataTable.Editor( {} );

I seem to be getting an error others are seeing:

ReferenceError: $ is not defined
at both/collections/RFQ.js:4:1
at both/collections/RFQ.js:232:1
at /Users/richardhsu/Desktop/sewp_tr_tool/.meteor/local/build/programs/server/boot.js:242:10
at Array.forEach (native)
at Function..each..forEach (/Users/richardhsu/.meteor/packages/meteor-tool/.1.1.10.1thygq0++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
at /Users/richardhsu/Desktop/sewp_tr_tool/.meteor/local/build/programs/server/boot.js:137:5
Exited with code: 8
Your application is crashing. Waiting for file change.

I think for some reason jQuery isn't loading before the library is imported. Has anyone used this with Meteor and if so, where do I put dataTables.editor.js?

Answers

  • rhsu0268rhsu0268 Posts: 5Questions: 1Answers: 0

    I also tried this block of code:

    if (Meteor.isClient)
    {
    var editor = new $.fn.dataTable.Editor( {} );
    }

    This is the error:

    $.fn.dataTable.Editor is not a constructor(anonymous function) @ RFQ.js:7(anonymous function) @ RFQ.js:232
    debug.js:41 Exception from Tracker afterFlush function:

    Anyone?

  • allanallan Posts: 63,276Questions: 1Answers: 10,424 Site admin

    It sounds like Editor might not be loaded. Have you got a link to the page you can give me so I can help to debug it?

    Allan

  • rhsu0268rhsu0268 Posts: 5Questions: 1Answers: 0

    Hi Allan,

    Thank you for your response and your outreach.

    Here is the link to my code:

    https://github.com/rhsu0268/Meteor

    I think part of the challenge is that I'm using Meteor as my framework and pulling in the files can be challenging. Do you have anyone on your team who has used datatable-editor in the context of Meteor.

    From a look at the forum, there were several people who had the same issue, and so I would think it would benefit many if instructions for how to use the datatable-editor plugin with meteor was posted somewhere on the references for the guide.

    Thanks,
    Richard

  • allanallan Posts: 63,276Questions: 1Answers: 10,424 Site admin

    Hi Richard,

    "My team" is me, and I'm afraid I've not used Meteor before.

    Is the repo you linked to ready to run? How do I run it if so, or does it require some configuration?

    Allan

  • rhsu0268rhsu0268 Posts: 5Questions: 1Answers: 0

    Hi Allan,

    First clone the project down. Then, change directory into the data-table editor.

    If you have meteor installed on your machine, you can run: "meteor run" and that will run the project in development mode.

  • allanallan Posts: 63,276Questions: 1Answers: 10,424 Site admin

    Its taken me an embarrassingly long time to get to this - sorry! I've just tried it and get:

    $ meteor run
    run: You're not in a Meteor project directory.

    I'm in the git repo root dir when running that command. Should I be somewhere else?

    Allan

This discussion has been closed.