Wednesday 17 May 2017

jquery tabulator in Node.js

I'm having trouble creating a tabulator in a javascript module in my Node.js app. I was able to follow the quick start directions to define the tabulator in my html file, but when I try to do the same thing in a javascript module I get an error that say "tabulator() is not a method". I also created a jquery-ui slider to be sure that part works.

I've installed jquery, jquery-ui and jquery.tabulator like this:

npm install jquery --save
npm install jquery-ui-dist --save
npm install jquery.tabulator --save

My html looks like this:

<div id="slider"></div>
<div id="tabulator"></div>

And my javascript looks like this:

const $ = require('jquery');
global.jQuery = $;
const jqueryui = require('node_modules/jquery-ui-dist/jquery-ui.min.js');
const jquerytabulator = require('node_modules/jquery.tabulator/tabulator.js');

...

$( document ).ready(function() {
    $('#slider').slider();        // this works and I get a slider on the page
    $('#tabulator').tabulator();  // this line gets an error
});

Any ideas?



via bmc0877

No comments:

Post a Comment