GithubHelp home page GithubHelp logo

Ability to Import as a Module about gantt HOT 7 CLOSED

dhtmlx avatar dhtmlx commented on June 13, 2024 2
Ability to Import as a Module

from gantt.

Comments (7)

ranebo avatar ranebo commented on June 13, 2024 1

Try import 'dhtmlx-gantt';
Then the gantt variable is accessible.
You will also need to import the css file either by the cdn or importing from the node_modules directory into your style sheet:
@import "../node_modules/dhtmlx-gantt/codebase/dhtmlxgantt.css"

from gantt.

gewisser avatar gewisser commented on June 13, 2024

Also interested is this question

from gantt.

kgish avatar kgish commented on June 13, 2024

+1

from gantt.

robv8r avatar robv8r commented on June 13, 2024

The best I could do is use bower. @plazarev and @Stanislav-Wolski are there any plans to migrate the JavaScript to either CJS, AMD, or ES6 so that we can use it in places other than a browser?

from gantt.

robv8r avatar robv8r commented on June 13, 2024

One option would be to port the Gantt to TypeScript and have it produce any module you like. My preference would be UMD since it covers nearly all use cases.

from gantt.

AlexKlimenkov avatar AlexKlimenkov commented on June 13, 2024

Hi,
currently, there are no plans to publish CJS/ES6/AMD compatible builds. Not in the sense that it was rejected, but we didn't do any research so far due to a very little demand. We have type definitions for TS https://www.npmjs.com/package/@types/dhtmlxgantt , so everything should be pretty usable with the TypeScript. The type definitions are a bit behind the latest version of gantt though, we'll update them soon.
Probably, we could wrap gantt declaration into UMD and keep current global declaration in order to break any compatibility, if it makes sense.

Regarding using dhtmlxgantt outside a browser - it's unlikely to happen soon, since again, we haven't researched it, and from the first look it may require quite a bit of change all around the codebase. Can you give me a use-case when you'll want to run gantt outside the browser?

I've added both items (CJS/AMD/UMD and running outside a browser) to the tracker to investigate later.

Closing the issue for now. Feel free to reopen the issue if you have any comments.

from gantt.

sergids avatar sergids commented on June 13, 2024

Feature already added in the last release

from gantt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.