Skip to content

Tabular DT Editor Integration #439

@smohantyCME

Description

@smohantyCME

I’ve gotten other DT extensions to work in this Meteor wrapper by doing something like the following

In Client Side Code
e.g.

I import an extension at the top of the module as such

import scroller from 'datatables.net-scroller-bs';

Then – I apply it to the window and jQuery instance by doing the following…
scroller(window, $);

Then --- in “Common Code”
I create a DT instance using the wrapper’s constructor

I do something like the following to get an extension to load

const profilesTable = new Tabular.Table({
    name: 'Profiles',
 
    //This is basically the ajax part…(except this comes from MongoDB via Pub/Sub…feature that is specific to Meteor)
    collection: Profiles,
 
    //This configures scroller and gets it to work on client side
    scroller: {
        loadingIndicator: true
    },
 
    columns: [
      MY_COLS
    ],
 
});

I’m able to import Editor on client side by doing
import editor from 'datatables.net-editor';

However, attempting to attach it to the window and jQuery like every other DT extension doesn’t work.
editor(window, $);

Looks like this is because Editor exports a TS Class and is not a Constructor expecting those params.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions