Giter Club home page Giter Club logo

Comments (6)

AlekseyMartynov avatar AlekseyMartynov commented on May 30, 2024 1

Hi there
In order to provide better assistance, we need to better understand the scenario and the issue.

Currently we realize the following:

  • The initial CodePen sample contains a misconfigured dxSelectBox but according to #2392 (comment) it's not the concern of the ticket.

  • From #2392 (comment) we can make the assumption that you don't want to load data unless there is a filter. This is fine if that approach works as expected.

  • If data bound to dxSelectBox is relatively small and static then I suggest to try loadMode="raw",
    a special mode in which only one fetch is made and the datasource configuration is much simplier:

    var orders = new DevExpress.data.CustomStore({
        loadMode: "raw",
        load: function () { 
            var deferred = $.Deferred();       
            $.ajax({ 
                url: "https://js.devexpress.com/Demos/WidgetsGallery/data/orderItems",
                success: function(result) {
                    deferred.resolve(result.items);
                },
                error: function() {
                    deferred.reject("Data Loading Error");
                },
                timeout: 5000
            });    
            return deferred.promise();
        }
    });

from devextreme.

jsdmitry avatar jsdmitry commented on May 30, 2024

Hi,
 
I researched your example and found out that you are using the displayExpr and the valueExpr options for the dxSelectBox incorrectly. The Name and the Id data fields are not contained in the dxSelectBox's data source. If you use the Employee field as displayExpr and the OrderNumber field - as valueExpr, unnecessary load methods will not will be called.
 
I kindly ask you to write in English, because our other customers can be interested in our answers.

from devextreme.

kodermax avatar kodermax commented on May 30, 2024

But I have api which contains Id and Name.
And this error is still there.

from devextreme.

kodermax avatar kodermax commented on May 30, 2024

I had to make a stub
image

from devextreme.

jsdmitry avatar jsdmitry commented on May 30, 2024

The displayExpr and valueExpr options should provide data fields of SelectBox's data source.
Please check that Id and Name data fields are contained in your remote data source.

from devextreme.

kodermax avatar kodermax commented on May 30, 2024

Thank you.
It works.

from devextreme.

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.