Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dhtmlx/gantt-data-provider

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dhtmlx/gantt-data-provider

Data proxy between client side Gantt widget and a server side API

  • 0.2.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Gantt Data Provider

Data proxy between client side Gantt widget and a server side API

NPM package

How to use

REST backend

import { RestDataProvider } from "@dhtmlx/gantt-data-provider";

// create an instance
const server = new RestDataProvider(url); // url = https://some.com

// get data
server.getData().then(({ tasks, links }) => {
    console.log(tasks, links);
});

// save changes
server.saveData({ 
    action: "add-task", /* add-task|update-task|delete-task|add-link|delete-link */
    obj: { /* GanttItem/LinkItem */ }
}).then(res => {
    console.log(res.id);
})
Backend URLs
  • tasks

    • add-task POST: {url}/tasks
    • update-task PUT: {url}/tasks/{id}
    • delete-task DELETE: {url}/tasks/{id}
  • links

    • add-link POST: {url}/links
    • update-link PUT: {url}/links/{id}
    • delete-link DELETE: {url}/links/{id}
Backend responses

For all actions client expect that server will respond with valid json object. Returning non-json response will be processed as an error.

For add-link/add-task actions, client expect that response will contain the server side ID (string or number) for the newly added item

{ id:"some" }
Data back propagation

It possible to update data after saving. To do so, you need to init the provider like next

// create an instance
const server = new RestDataProvider(url, {
    task: res => updateTask(res),
    link: res => updateLink(res)
});

after add-link/add-task/update-link/update-task actions, the updateTask/updateLink handlers will be called with response details, so the saved task/link can be updated ( or you can trigger any other custom after-save processing )

FAQs

Package last updated on 24 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc