Current filter:
                                You should refresh the page.
                                  • Hi Team,

                                    I am trying to bind the lookup column in datagrid but it is not binding the values. My problem is similar like this ticket but solution is not working for me.

                                    I also have list object added to scope but lookup column is not showing values because grid is rending before below object is populated.

                                    [JavaScript]
                                    $scope.occupation = [];

                                    I tried to use below but seems it is not working in MultiRow Header scenario.

                                    [JavaScript]
                                    'columns[5].lookup.dataSource': 'occupation'

                                    But for below multirow scenario it is not working. I tried to find the columnIndex by debugging OnCellPrepared, onEditorPreparing but nothing worked.

                                    Somehow two way binding i.e. Lookup DataSource  is not getting updated after grid is loaded.

                                    [JavaScript]
                                    columns: [ { caption: "Program", alignment: "center", columns: [{ caption: "Details", alignment: "center", columns: [ { dataField: 'id', allowResizing: true }, "first_name", "last_name", "company", "father_name", { dataField: 'occupation_id', lookup: { valueExpr: 'id', displayExpr: 'descr', title: 'Occupation' } }, "country_code", { dataField: 'birthdate', dataType: 'date' } ] }] } ]
                                • Alisher (DevExpress Support) 10.17.2019

                                  Hello,

                                  Please create a simple runnable example or modify the https://js.devexpress.com/Demos/WidgetsGallery/Demo/DataGrid/CascadingLookups/AngularJS/Light/ demo to demonstrate how the DataGrid widget is configured and how its lookup column's options are specified so that I can examine it.
                                  I hope to hear from you soon.

                                • Parag Patil 3 10.17.2019

                                  Hi,

                                  I have created CodePen sample.

                                  I have declared variable var stateruntime = []; that will be blank on initial page load.

                                  After service return data I am assigning that data to this variable. stateruntime = states;

                                  I am expecting lookup column to show the updated values.

                                  Expected behavior, lookup should be two way binding and whenever lookup's data Source updated, SelectBox should reflect those values.

                                  I have already referred this but I can't call API from this JS page. Calling http.get and post are handled at center place in our application. This page is expecting it will get array of JSON objects for states variable.

                                  [JavaScript]
                                  load: function() { // Returns an array of objects that have the following structure: // { id: 1, name: "John Doe" } return $.getJSON("https://mydomain.com/MyDataService/authors/"); }

                                1 Solution

                                Creation Date Importance Sort by

                                Hello Parag,

                                To resolve the issue, assign a function to the lookup's dataSource option. The function should return a data source configuration where your $scope.stateruntime parameter is assigned to the store option. Review how the dataSource option is implemented for the CityID column to catch the idea.

                                • AndreaDellepiane 12.02.2019

                                  I have a similar problem. Here is my lookup datasource function:

                                  [JavaScript]
                                  codiceDataSourceConfiguration = (options) => { if(!options.data) return []; var id=options.data.IdCommessa; return { // store: new CustomStore({ loadMode: 'processed', key: 'id', load: loadOptions => { let url = new URL(appInfo.apiUrl() + 'destinazioni/commesse/' + id); if (loadOptions !== undefined && loadOptions !== null) { let params = { s: loadOptions.searchValue }; Object.keys(params).forEach(key => url.searchParams.append(key, params[key])); } return fetch(url, appInfo.headers()) .then((response) => { if (response.status !== 200) { return response.json() .then((r) => { return Promise.reject(r) }); } return response.json(); }); }, byKey: key => { let url = new URL(appInfo.apiUrl() + 'destinazioni/sottocommesse/' + key); return fetch(url, appInfo.headers()) .then((response) => { if (response.status !== 200) { return response.json() .then((r) => { return Promise.reject(r) }); } return response.json(); }); } // }) }; }

                                  and there it's my column definition:

                                  [HTML]
                                  <Column dataField={'IdSottocommessa'} caption={'IdSottocommessa'} allowEditing={true} > <Lookup dataSource={this.codiceDataSourceConfiguration } displayExpr={'descrizione'} valueExpr={'id'}></Lookup> </Column>

                                  I am using editing mode='cell' and React. I can see the decoded value only when I click on the lookup column (as you can see in attached screenshot)
                                  What am I missing here?

                                • Alisher (DevExpress Support) 12.02.2019

                                  Hello,

                                  I've created a separate ticket on your behalf (T837706: dxDataGrid - Lookup displays value only when clicked). It has been placed in our processing queue and will be answered shortly.