AnsweredAssumed Answered

How do I bind my address candidates to a data grid?

Question asked by csergent08 Champion on Jul 31, 2015

I am going off this example: Show find task results in a DataGrid | ArcGIS API for JavaScript

 

And this appears to be the block of code that I need to populate my grid with the exception of the rowclick handler:

//Create data store and bind to grid.
          store = new ItemFileReadStore({
            data : data
          });
          var grid = registry.byId("grid");
          grid.setStore(store);
          grid.on("rowclick", onRowClickHandler);

 

 

I want to populate my address candidates that are found here:

if (addressCandidates.length > 1) {
                         for (a = 0; a < addressCandidates.length; a++) {
                             // This is the address that should go into a grid cell
                             console.log(addressCandidates[a].address);
                            
                         }


                     }

This code loops through to obtain each address candidate. I would like to bind the address candidate to the grid as I loop through the code. How do I do that?

 

Here is the complete code:

JS Bin - Collaborative JavaScript Debugging

Outcomes