Skip to content

Override base functions

Roberto Prevato edited this page May 2, 2017 · 1 revision

The KingTable library offers two ways to override base functions:

  • when developing using the source ES6 code, use the built-in extends syntax and class definition
  • when instantiating a KingTable, pass a second parameter inside the constructor: it will be used to extend the instance

Example:

var table = new KingTable({
  // options as first parameter
}, {
  build: function () {} // overrides the base `build` function of the KingTable
});

This approach doesn't override the base definition of the KingTable prototype.

Clone this wiki locally