<div id="leftPane" dojotype="dijit.layout.ContentPane" region="left"> <div dojotype="dijit.layout.TabContainer" > <div dojoType="dijit.layout.ContentPane" title="Legend" selected="true"> <div id="legendDiv"></div> </div> <div id="searchCol" dojoType="dijit.layout.ContentPane" title="Find Results"> <table dojoType="dojox.grid.DataGrid" jsid="grid1" id="grid1" class="searchResultsGrid" rowsPerPage="10" rowSelector="20px" style="visibility:hidden;"> <thead> <tr > <th width="100px" field="site_code">FacID</th> <th width="185px" field="facil_name">Fac Name</th> </tr> </thead> </table> <table dojoType="dojox.grid.DataGrid" jsid="grid2" id="grid2" class="searchResultsGrid" rowsPerPage="10" rowSelector="20px" style="visibility:hidden;"> <thead> <tr > <th width="100px" field="site_code">FacID</th> <th width="185px" field="facil_name">Fac Name</th> </tr> </thead> </table> </div> </div> </div>
<div id="searchCol" dojotype="dijit.layout.ContentPane" region="left"> <table dojoType="dojox.grid.DataGrid" jsid="grid1" id="grid1" class="searchResultsGrid" rowsPerPage="10" rowSelector="20px" style="visibility:hidden;"> <thead> <tr > <th width="100px" field="site_code">FacID</th> <th width="185px" field="facil_name">Fac Name</th> </tr> </thead> </table> <table dojoType="dojox.grid.DataGrid" jsid="grid2" id="grid2" class="searchResultsGrid" rowsPerPage="10" rowSelector="20px" style="visibility:hidden;"> <thead> <tr > <th width="100px" field="site_code">FacID</th> <th width="185px" field="facil_name">Fac Name</th> </tr> </thead> </table> </div>
function searchMap(){ var searchBox = dojo.byId("txtSearch"); var searchText = searchBox.value; searchText = searchText.replace(/-/g,""); findParams.searchText = searchText; searchBox.value = searchText; if (searchText != "") { featureID = ""; startStatusUpdate(1000); findTask.execute(findParams, showResults); } } function showResults(results){ hidePopup(); searchResults = results; featureSet = null; var items = []; //all items to be stored in data store clearStatusUpdate(); for (var i = 0; i < results.length; i++) { items.push(results.feature.attributes); //append each attribute list as item in store } setSearchResultItems2(items); } function setSearchResultItems2(items){ var data = { identifier: keyFieldAlias, //This field needs to have unique values label: addressFieldAlias, //Name field for display. Not pertinent to a grid but may be used elsewhere. items: items }; dojo.byId("grid1").style.visibility = "hidden"; dojo.byId("grid1").style.display = "none"; dojo.byId("grid2").style.visibility = "visible"; dojo.byId("grid2").style.display = "block"; //Create data store and bind to grid. store = new dojo.data.ItemFileReadStore({ data: data }); grid2 = dijit.byId("grid2"); grid2.setStore(store); grid1HasResults = false; grid2HasResults = true; }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.