How do i use NodesTable to create a table starting from a specific folder?

I'm trying to use 'd2/sdk/widgets/nodestable/nodestable.view', and it keep gives me error on "this.options.d2tableColumns is not a constructor"

here's my code

    var CaseFolderView = NodesTableView.extend({
        constructor: function CaseFolderView(options) {
            options = options || {};
            options.className = 'my-table-view';
            options.collectionClass= NodeCollection
            NodesTableView.__super__.constructor.call(this, options);
          },
    })

Also how do I set the starting point of this nodestable, i want it to open a specific folder when i initiate it.

Can you give me a sample to make this work? Thanks

Answers

  • Hello @lementree,

    We are delighted to know that you're exploring our D2SV SDK API and providing us feedback on those. This really helps us to mature our APIs over time.

    Now getting to the problem you've shared; we understand that your end goal is to show contents of a particular cabinet/folder in the UI. With this goal, what you're trying with NodesTableView , is going to work but it'll take a lot of boiler plating before you can actually render the data in UI.

    There is an easy alternative, which quickly lets you open a cabinet/folder in the default Doclist itself. We've put together a small sample for your reference. The zip file contains a READ_ME.txt file inside, that will help with further instructions.

    Please try it out, and let us know if it caters to your requirement. If it doesn't, we'll suggest a fix for your original approach with NodesTableView.

    Thanks,
    Jayanta