Pop Up Window Results to Data Grid

438
2
Jump to solution
05-07-2012 12:52 PM
JoanBiediger
New Contributor III
Hi All,

I have been searching the samples and have not really found what I am looking for.  I have a popup info window and I would like to be able to have the user click a link in the window and have the results returned to a data grid.

Thanks for your help
0 Kudos
1 Solution

Accepted Solutions
TomJacoby
New Contributor III
This should work for you.  Its less about the map api and more about getting it to work in the javascript. I use jquery.

Here is the code to make things work:
// <Init> map.graphics.enableMouseEvents(); dojo.connect(map.graphics, "onClick", function(evt) {     map.infoWindow.setContent("<a href='#' onclick='getDataResults(evt.graphic.attributes.Id)'>Get Data Results</a>"); // Assumes id is on the graphic somewhere }); // </Init> function getDataResults(id) {    $.get('/GetSomeResults/' + id,  function (content) {   document.getElementById('resultsGrid').innerHTML = content;  } ); }


and some HTML:
[HTML]<div id="resultsGrid"></div>[/HTML]

View solution in original post

0 Kudos
2 Replies
TomJacoby
New Contributor III
This should work for you.  Its less about the map api and more about getting it to work in the javascript. I use jquery.

Here is the code to make things work:
// <Init> map.graphics.enableMouseEvents(); dojo.connect(map.graphics, "onClick", function(evt) {     map.infoWindow.setContent("<a href='#' onclick='getDataResults(evt.graphic.attributes.Id)'>Get Data Results</a>"); // Assumes id is on the graphic somewhere }); // </Init> function getDataResults(id) {    $.get('/GetSomeResults/' + id,  function (content) {   document.getElementById('resultsGrid').innerHTML = content;  } ); }


and some HTML:
[HTML]<div id="resultsGrid"></div>[/HTML]
0 Kudos
JoanBiediger
New Contributor III
Hi Tom,

Thanks for your help!!

Joan
0 Kudos