Tabulator: Version 4.0 Footer Error

Created on 6 Sep 2018  路  3Comments  路  Source: olifolkerd/tabulator

Is there a thread to submit possible errors?

Anyway, with this code

     $(document).ready(function () {   
       var table = new Tabulator("#overzicht73", {
footerElement:"<div class='tabulator-footer'><button>Custom Button</button></div>"
  });

});

I get the following console error :

jquery-3.3.1.js:3827 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
at FooterManager.activate (tabulator-4.0.js:5921)
at Tabulator._buildElement (tabulator-4.0.js:6511)
at Tabulator._create (tabulator-4.0.js:6422)
at new Tabulator (tabulator-4.0.js:5962)
at HTMLDocument. (administratie.php:42)
at mightThrow (jquery-3.3.1.js:3534)
at process (jquery-3.3.1.js:3602)

Maybe has something to do with the jquery wrapper, or I have to change it to a dom node (like in the code changes example) , but then it's not clear to me how.

Thanks and great work !

Bug Question - Ask On Stack Overflow

All 3 comments

Hey @tomvanlier

Thanks for the heads up, i have just pushed a fix for that to the 4.0 branch.

For your information you can pass one of three things to the footerElement option:

the element outside the table where you would like the footer to appear:

<div id="page-controls"></div>
<div id="example-table"><div>
var table = new Tabulator("#example-table", {
    footerElement: getElementById("page-control");
});

the selector for the element outside the table where you would like the footer to appear:

var table = new Tabulator("#example-table", {
    footerElement: "#page-control",
});

or the contents you want added to the built in footer element

var table = new Tabulator("#example-table", {
    footerElement: "<button>Custom Button</button>",
});

In your case you want to use the third option, and you dont need to worry about wrapping it in a footer element.

I hope that helps,

Cheers

Oli :)

hello!, i wonder that how can add click event on footherElement's button click event??

Can I do this??
<button onclick="myFunction()">Click me</button>

You can do that, it works like a charm.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Honiah picture Honiah  路  3Comments

KES777 picture KES777  路  3Comments

sphynx79 picture sphynx79  路  3Comments

andreivanea picture andreivanea  路  3Comments

Manbec picture Manbec  路  3Comments