Select to view content in your preferred language

Datagrid Results Only Appear After Browser Resize

1149
4
10-24-2011 10:41 AM
EmilyLaMunyon
Deactivated User
Hello,

I have a query task that displays results in a datagird at the bottom of my map. The query function seems to be working, however, the results do not appear in the table unless I manually resize my browser. I think it may be a refresh and/or resize issue, but since I am a newbie, I am not sure. Has anyone else run into this issue before? I have included the code I think may be having issues.

Thanks!!

  map = new esri.Map("map",{ nav:true, extent:intExtent, lods: lods});

        //Add the topographic layer to the map. View the ArcGIS Online site for services http://arcgisonline/home/search.html?t=content&f=typekeywords:service     
        var basemapUrl = "http://mapserv.utah.gov/ArcGIS/rest/services/UtahBaseMap-Terrain/MapServer"; 
        var basemap = new esri.layers.ArcGISTiledMapServiceLayer(basemapUrl); 
        var dynamicURL = "http://gis.slco.org/wwwrest/services/public/Surveyor/MapServer"; 
        dynamicMap = new esri.layers.ArcGISDynamicMapServiceLayer(dynamicURL);
   esri.config.defaults.geometryService = new esri.tasks.GeometryService
   ("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"); 
 
 
   var measurement = new esri.dijit.Measurement({ 
            map: map 
          }, dojo.byId('measurementDiv')); 
           
          measurement.startup(); 
           
 
   


        map.addLayer(basemap); 
        map.addLayer(dynamicMap);
        //create find task with url to map service 
        findTask = new esri.tasks.FindTask("http://gis.slco.org/wwwrest/services/public/Surveyor/MapServer"); 
 
     
  dojo.connect(map, "onLoad", function(map) { 
          dojo.connect(dijit.byId('map'), 'resize', map,map.resize); 
          
    var overviewMap = new esri.dijit.OverviewMap({map: map},dojo.byId("overviewDiv")); 
          overviewMap.startup(); 
        });
         if (dynamicMap.loaded) { 
          buildLayerList(dynamicMap); 
         // alert("is loaded");
        } 
        else { 
          dojo.connect(dynamicMap, "onLoad", buildLayerList);
          //alert("now loaded"); 
        } 
      } 
 function initFunctionality(map) { 
        dojo.connect(map, "onClick", doIdentify); 
 
        identifyTask = new esri.tasks.IdentifyTask("http://gis.slco.org/wwwrest/services/public/Surveyor/MapServer"); 
 
        identifyParams = new esri.tasks.IdentifyParameters(); 
        identifyParams.tolerance = 3; 
        identifyParams.returnGeometry = true; 
        identifyParams.layerIds = [1,6]; 
        identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_ALL; 
        identifyParams.width  = map.width; 
        identifyParams.height = map.height; 
         
        map.infoWindow.resize(415, 200); 
        //map.infoWindow.setContent(dijit.byId("tabs").domNode); 
        //map.infoWindow.setTitle("Identify Results"); 
 
        }
0 Kudos
4 Replies
TonyMonsour
Deactivated User
This tends to happen if the grid is hidden or minimized when the data is sent to it.  If that is the case, try resizing the grid before you send the data to it.  The other option is after your whole function completes you can refresh the grid via javascript, grid.refresh() or something to that extent.
-T
0 Kudos
EmilyLaMunyon
Deactivated User
Thanks for the reply. I tried adding grid.refresh() to the following code and still no luck. What am I missing?


     
      function showDocNumGrid(){
        //alert('DocNum');
  dojo.byId('map').style.height='80%';
  dojo.byId('footerCity').style.display = "none";
     dojo.byId('footerDocNum').style.display = "block";
      grid.refresh();  
    }
    
   function showCityGrid(){
        //alert('City');
  dojo.byId('map').style.height='80%';
  dojo.byId('footerCity').style.display = "block";
     dojo.byId('footerDocNum').style.display = "none";
     grid.refresh();
    }
0 Kudos
TonyMonsour
Deactivated User
Earlier I posted you wanted to use grid.refresh or grid.update() to 'reload'/ fix your grid. 
What you want to keep in mind is that your grid is probably in another dojo pane ie. a dijit.layout.ContentPane.  What you want to do is .resize() that pane as well if that whole pane was hidden and you should be good to go.
0 Kudos
EmilyLaMunyon
Deactivated User
Thanks so much! I will give that a shot and see what happends.

My grid is in a content pane.
0 Kudos