dexconor

Search result with dojo grid, result table won't work

Discussion created by dexconor on May 2, 2014
Latest reply on May 7, 2014 by dexconor
Hi

<table data-dojo-type="dojox.grid.DataGrid" data-dojo-id="grid" id="grid" data-dojo-props="rowsPerPage:'1', rowSelector:'10px'" noDataMessage="No results found" loadingMessage="Loading data...">
<thead>
<tr>
<th field="MapDisplay" width="275">Results</th>
</tr>
</thead>
</table>


it works fine before but now results display on the map but <th field="MapDisplay" width="275">Results</th>
just shows "Results" just text not the top of the table.

Where should I look to solve the problem?

rest of code for search function (didn't make changes)
function doFind() {
    findParams.searchText = dojo.byId("searchField").value;
    findTask.execute(findParams, showResults);
}

function showResults(results) {
    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([80, 0, 0]), 2), new dojo.Color([255, 255, 0, 0.5]));
    var items = dojo.map(results, function (result) {
        var graphic = result.feature;
        graphic.setSymbol(symbol);
        map.graphics.add(graphic);
        return result.feature.attributes;
    });
    var data = {
        identifier: "OBJECTID",
        label: "OBJECTID",
        items: items
    };
    store = new dojo.data.ItemFileReadStore({
        data: data
    });
    dojo.style(dojo.byId("grid"), "width", "315px");
    dojo.style(dojo.byId("grid"), "height", "245px");
    var grid = dijit.byId('grid');
    grid.setStore(store);
    grid.resize();
    autoWidth: true;
    autoHeight: true;
    map.centerAndZoom(center, zoom);
}
function onRowClickHandler(evt) {
    var clickedTaxLotId = grid.getItem(evt.rowIndex).OBJECTID;
    var selectedTaxLot;
    dojo.forEach(map.graphics.graphics, function (graphic) {
        if ((graphic.attributes) && graphic.attributes.OBJECTID === clickedTaxLotId) {
            selectedTaxLot = graphic;
            return;
        }
    });
    var taxLotExtent = selectedTaxLot.geometry.getExtent();
    map.setExtent(taxLotExtent);
}
function hideResults() {
    map.graphics.clear();
 var newStore = new dojo.data.ItemFileReadStore({data: {  identifier: "",  items: []}});
    var grid = dijit.byId("grid");
    grid.setStore(newStore); 
}


Thank you for your time

Outcomes