Querying from a table view and posting results in data grid - JavaScript?

1452
3
12-17-2014 10:02 AM
IanPeebles
Occasional Contributor III

I currently have a table view set up in SDE that pulls a lot of utility information together.  I am currently working on a JavaScript application that will allow a use to type in an address or name, then the results will be posted into a data grid.

The problem is this, I can get this to work with any map service layer, but not with a table view.  The table view in the map service contains an ID of 1.  This particular application will not have a map service, just input parameters and a data grid.  That is it.

I can run queries through the REST endpoint and get the results I want.

My question is, what is the correct class to use for querying from table views.  I thought I could use findParams, but that doesn't seem to work.

Anyone have any ideas?

Thanks!

Tags (1)
0 Kudos
3 Replies
YungKaiChin
Occasional Contributor

Is the table view a spatial service? You may be able to query records from the table view via merely Query and QueryTask.

0 Kudos
IanPeebles
Occasional Contributor III

I have the table view in a map service.  Attached is a screenshot:

I can easily query from the CISAddresses using an Id of 0 for the LayerID, just not the table view as shown.GeoNet_Screenshot.jpg

0 Kudos
SteveCole
Frequent Contributor

Unless I'm missing something, I do exactly this in one of my apps. Here's the REST Service directory for my published service with the table so you can see that it's set up just like your service. As part of my overall app (it shows stream gauge readings in our County), you can view a larger hydrograph in a new window. The new window opens, loads the JS API and does a QueryTask on that table to retrieve the data to be displayed in the graph.

It's written in legacy coding but here's an example link.

0 Kudos