question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to import DevExpress.data.CustomStore ?

See original GitHub issue

How to import DevExpress.data.CustomStore into TypeScript?

The only place I found this declaration is in devextreme/dist/ts/dx.all.d.ts. However, when I try

import { CustomStore } from 'devextreme/dist/ts/dx.all';

it doesn’t work. It gives: [ts] File 'devextreme/dist/ts/dx.all.d.ts' is not a module. – which is comprehensible, since there isn’t a dx.all.js in this same folder.

For the sake of completion: I’m trying to port this code from Angular 1.5:

    this.gridDataStore = new DevExpress.data.CustomStore({
        load: (loadOptions) => $q.resolve(this.getBuffer(loadOptions.skip, loadOptions.skip + loadOptions.take)),
        totalCount: () => $q.resolve(this.data.length),
        update: (key, values) => { this.data[key.a] = values.c; return $q.resolve(values); }
    });

Using “devextreme-angular2”: “^16.1.7” “typescript”: “2.0.3”

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
GoshaFightencommented, Oct 21, 2016

You can do this in version 16.2. Recently, we published an alpha version of 16.2: 16.2.1-alpha.1. With this version, you can declare CustomStore like this:

import CustomStore from "devextreme/data/custom_store";

orders = new CustomStore({
    load: (opts) => {
        return new Promise((resolve, reject) => {
            resolve([{ text: "Test" }]);
        });
    },
    totalCount: (opts) => {
        return new Promise((resolve, reject) => {
            resolve(1);
        });
    }
});

GH165.zip

2reactions
GoshaFightencommented, Oct 20, 2016

@fdcastel I think you are getting the Cannot find name 'DevExpress' error when tsc compiles our component. To resolve the issue, declare DevExpress in the following way:

declare let DevExpress: any; GH165.zip

Read more comments on GitHub >

github_iconTop Results From Across the Web

CustomStore - DataSource - DevExtreme - DevExpress
The CustomStore enables you to implement custom data access logic for consuming data from any source. Included in: dx.web.js, dx.viz.js, dx.all.js. import ......
Read more >
JavaScript Custom Store Configuration - DevExtreme
var store = new DevExpress.data. ... import CustomStore from 'devextreme/data/custom_store';; import DataSource from 'devextreme/data/data_source'; ...
Read more >
Use CustomStore: DevExtreme - JavaScript UI Components ...
Custom Store is a Store that allows you to connect a UI component to a web service with its own data accessing logic....
Read more >
Custom Data Sources - DevExtreme - DevExpress
DevExtreme provides the CustomStore component to load and edit data from any data ... import React from 'react';; import 'devextreme/dist/css/dx.light.css'; ...
Read more >
Documentation: DevExtreme - JavaScript Custom Store Methods
import CustomStore from "devextreme/data/custom_store";; import DevExpress from "devextreme/bundles/dx.all"; ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found