1

I'm trying to integrate slickgrid into a meteor application. I've tried the existing atmosphere package for SlickGrid. I've also tried building my own smart-package.

Either way, I can't get the Slick namespace to show up on on the client side. I suspect that it has something to do with the way that the slickgrid code handles namespacing. They do it as follows in their slick.core.js file:

(function ($) {
  // register namespace
  $.extend(true, window, {
    "Slick": {
      "Event": Event,
      "EventData": EventData,
      "EventHandler": EventHandler,
      "Range": Range,
      "NonDataRow": NonDataItem,
      "Group": Group,
      "GroupTotals": GroupTotals,
      "EditorLock": EditorLock,

      /***
       * A global singleton editor lock.
       * @class GlobalEditorLock
       * @static
       * @constructor
       */
      "GlobalEditorLock": new EditorLock()
    }
  });

I've tried some other code snippets with that style of namespacing and it didn't seem to work. What is the right approach here? I could edit the SlickGrid files to use a different namespacing approach, but that seems rather hackish and I'd like to avoid doing it if possible.

Justin Gray
  • 5,605
  • 1
  • 11
  • 16
  • Duplicate of [How can I integrate SlickGrid with Meteor.js reactive collections?](http://stackoverflow.com/questions/10356573/how-can-i-integrate-slickgrid-with-meteor-js-reactive-collections). I would vote to close if the almighty SO gods opened the other one. – Dan Dascalescu Dec 02 '14 at 11:04
  • Have a look at the updated [Packaging existing libraries](http://www.meteorpedia.com/read/Packaging_existing_Libraries). – Dan Dascalescu Dec 02 '14 at 11:06

1 Answers1

0

Both linked packages are missing export call. If you have a global variable in your package that should be accessible from outside, you need to add the following line to your Package.on_use method:

Package.on_use(function(api) {
  ...

  api.export('SlickGrid', 'client');
  ...
});
Hubert OG
  • 19,314
  • 7
  • 45
  • 73
  • That does seem to be the solution. However, adding the export by itself is not enough. According to [this](https://github.com/awwx/misc/wiki/Packaging-Existing-Libraries-for-Meteor) post, the style of namespacing in SlickGrid is still going to be a problem. To use it, I'll have to re-work some of the core SlickGrid files. – Justin Gray Apr 15 '14 at 10:50