DataGrid Error - 304 Not Modified

2124
3
Jump to solution
11-06-2012 03:28 AM
CraigMcDade
Occasional Contributor III
I'm getting a error with dojox.grid.DataGrid

I had a test application that I used to get the code how I wanted it, it worked. I then switched the code to my full application and it no longer works. When I do the search in my full app it does the search and returns the results (that I can see in firebug) however, the grid is not populated and the graphic is not returned on the map. Below is what firebug is showing me:

[ATTACH=CONFIG]19055[/ATTACH]

And below is the code I am using to perform the search:

function doFind() {         //Set the search text to the value in the box         findParams.searchText = dojo.byId("parcel").value;     //grid.showMessage("Loading..."); //Shows the Loading Message until search results are returned.         findTask.execute(findParams,showResults);       }        function showResults(results) {         //This function works with an array of FindResult that the task returns         map.graphics.clear();         var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([98,194,204]), 2), new dojo.Color([98,194,204,0.5]));           //create array of attributes         var items = dojo.map(results,function(result){           var graphic = result.feature;           graphic.setSymbol(symbol);           map.graphics.add(graphic);           return result.feature.attributes;         });                   //Create data object to be used in store         var data = {           identifier: "Parcel Identification Number",  //This field needs to have unique values. USES THE ALIAS!!!           label: "PARCELID", //Name field for display. Not pertinent to a grid but may be used elsewhere.           items: items         };           //Create data store and bind to grid.         store = new dojo.data.ItemFileReadStore({ data:data });         var grid = dijit.byId('grid');         grid.setStore(store);          //Zoom back to the initial map extent         map.setExtent(startExtent);        }        //Zoom to the parcel when the user clicks a row       function onRowClickHandler(evt){         var clickedTaxLotId = grid.getItem(evt.rowIndex).PARCELID;         var selectedTaxLot;          dojo.forEach(map.graphics.graphics,function(graphic){           if((graphic.attributes) && graphic.attributes.PARCELID === clickedTaxLotId){             selectedTaxLot = graphic;             return;           }         });         var taxLotExtent = selectedTaxLot.geometry.getExtent();         map.setExtent(taxLotExtent);       }


There are other parts of the code obviously, not sure what will be relevant to find the answer/error.
0 Kudos
1 Solution

Accepted Solutions
JohnGravois
Frequent Contributor
i think i spoke  too soon.  it appears the code you posted is still working in our 3.2 sample.  i'd still recommend stepping through the showResults function though.

View solution in original post

0 Kudos
3 Replies
JohnGravois
Frequent Contributor
the fact that results are being returned, but you are not able to draw associated graphics is a clue that things are going wrong in your showResults callback function.  have you tried setting a breakpoint and stepping through that code to interrogate the values stored in each variable?

i took a look at the dojo documentation and it seems that you can no longer use the syntax included in the code you attached starting at Dojo version 1.7.  since we migrated to this underlying version of Dojo starting with version 3.0 of the Esri JavaScript API, is it possible that you are referencing a 3.x version in your production app, but not in your simplified sample?
0 Kudos
JohnGravois
Frequent Contributor
i think i spoke  too soon.  it appears the code you posted is still working in our 3.2 sample.  i'd still recommend stepping through the showResults function though.
0 Kudos
CraigMcDade
Occasional Contributor III
EDIT**

Turns out I had two showResults functions. Deleted one, and now the results return.

I'm enrolled in the Building Web Applications Using ArcGIS API for JavaScript class this Thurs and Fri so hopefully I'll learn more about how to test and implement this stuff! Until then, I'm going to continue beating my head against the desk.
0 Kudos