AnsweredAssumed Answered

How do I write address candidates to a grid?

Question asked by csergent08 Champion on Jul 30, 2015
Latest reply on Jul 31, 2015 by csgeosol1

I want to place my address candidates in a grid that is created on the fly. I want to then allow the user to be able to click on one of the address candidates in the list and display that in the address candidate that was clicked in the console.


I've looked here and this looks like what I want, but it also looks like too much. I am not sure what I could take out: Show find task results in a DataGrid | ArcGIS API for JavaScript


I have also looked here:  dojox.grid.DataGrid — The Dojo Toolkit - Reference Guide



My code will not run correctly in JSBin. I have done my testing in Google Chrome.


Here is my code:

<!DOCTYPE html>
<html lang="en">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="">
    <link rel="stylesheet" href="">
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
       <script src="//"></script>
       <script src="//"></script>

    <label id="lblOwnerAddress" for="ownerAddress">Owner's Address</label>
    <input type="text" id="ownerAddress" name="ownerAddress" value="111 S Main" />
    <script src=""></script>
         function (on, Locator) {

             on(document.getElementById('ownerAddress'), 'focusout', checkAddress);

             function checkAddress() {
                 var locator = new Locator("");
                 var node = document.getElementById('ownerAddress');
                 // according to your service it takes Single Line
                 var params = {
                     "Single Line Input": node.value
                 locator.addressToLocations(params).then(function (addressCandidates) {
                     //console.log('success', addressCandidates);
                     if (addressCandidates.length > 1) {
                         for (a = 0; a < addressCandidates.length; a++) {
                             // This is the address that should go into a grid cell


                     var adresses =  {
                         return x.address;


                 }).otherwise(function (err) {
                     console.log('somethings wrong', err);