require(["dojox/grid/DataGrid", "dojo/ready", "esri/tasks/query","esri/tasks/QueryTask", "dojo/dom","dojo/on","dojo/domReady!"], function(DataGrid,ready,Query,QueryTask,dom,on){ ready(function(){ var myQueryTask, myQuery; myQueryTask = new QueryTask("http://services.azgs.az.gov/ArcGIS/rest/services/aasggeothermal/AZWellHeaders/MapServer/0"); myQuery = new Query(); myQuery.returnGeometry = false; myQuery.outFeilds = ["*"] function runQuery(){ var apiNo = dom.byId('apinum').value; var otherId = dom.byId('stateperm'); myQuery.where ="apino like '%" + apiNo + "%'" + "OR" + "otherid like '%" + otherId + "%'"; myQueryTask.execute(myQuery,showResults); } function showResults(myFeatures){ console.log(myFeatures); var s = ""; for (var i=0, il=myFeatures.features.length; i < il; i++) { var featureAttributes = myFeatures.features.attributes; for (att in featureAttributes) { s = s + "<strong>" + att + ": </strong>" + featureAttributes[att] + "<br />"; } } dojo.byId("info").innerHTML = s; } on(dom.byId("executeButton"), "click", runQuery); }); });
Solved! Go to Solution.
myQuery.where ="apino like '%" + apiNo + "%'" + " OR " + "otherid like '%" + otherId + "%'";
myQuery.where ="apino like '%" + apiNo + "%'" + " OR " + "otherid like '%" + otherId + "%'";