AnsweredAssumed Answered

jquery linklist

Question asked by jkgisguy on Jan 8, 2013
Latest reply on Jan 11, 2013 by jkgisguy
I'm having alot of trouble with a sample from the esri site. I have almost everything working but the click on a returned set of values only passes the last result in the list to the map. Any ideas?

function showResults(results) {
     //create a pick list of results
     $.each(results, function(i, result) {
        var li = $('<li class="linklist"/>');
               $('.linklist').click(function() {
               addResult(result);
               });
                                      
                                         //create the list content
                                        var content = "<a href='#'>" + result.address + "</a>";
                   li.append(content);
                                        //add the list item to the feature type list
                                        $('#searchList').append(li);
                                });
                                //refresh the featurelist so the jquery mobile style is applied
                                $('#searchList').listview('refresh');
        }

Outcomes