getting a TypeError

4167
14
10-18-2014 04:50 AM
joepublic
New Contributor III

I am still new to esri's js-api.  I am getting the error below at line 149 (queryTask.execute(cntryq);) in the attached file.

I have no idea how to resolve this error

TypeError {stack: "TypeError: undefined is not a function↵ at coun…ndler (http://js.arcgis.com/3.10/init.js:490:212)", message: "undefined is not a function"}

  1. message: "undefined is not a function"
  2. stack: "TypeError: undefined is not a function↵ at countries (http://tobagoborn.com/esri/examples/p1p2c.html:149:15)↵ at cntrycds (http://tobagoborn.com/esri/examples/p1p2c.html:163:5)↵ at http://tobagoborn.com/esri/examples/p1p2c.html:179:7↵ at S._resolve (http://js.arcgis.com/3.10/js/esri/layers/FeatureLayer.js:64:294)↵ at k (http://js.arcgis.com/3.10/js/esri/layers/FeatureLayer.js:65:355)↵ at c (http://js.arcgis.com/3.10/init.js:74:221)↵ at d (http://js.arcgis.com/3.10/init.js:74:10)↵ at resolve.callback (http://js.arcgis.com/3.10/init.js:75:350)↵ at Object.n._resDfd (http://js.arcgis.com/3.10/init.js:758:31)↵ at e._successHandler (http://js.arcgis.com/3.10/init.js:490:212)"
Tags (1)
0 Kudos
14 Replies
DanPatterson_Retired
MVP Emeritus

can you redirect your post to an appropriate Place to facilitate answering

0 Kudos
joepublic
New Contributor III

Where is the appropriate place??

0 Kudos
DanPatterson_Retired
MVP Emeritus

See the big Places link to the left of your avatar, click on it, then you can select a Space and post/move your question there.  I am guessing you have some sort of java question but it could go in several spots, ie what are you using/developing. you will get better response if you use places/spaces and tags to direct your questions otherwise they end up in the void

0 Kudos
joepublic
New Contributor III

I am using ESRI's javascript API so I think I need someone from ESRI to look at it

Correct??

0 Kudos
DanPatterson_Retired
MVP Emeritus

If someone from Esri has to look at it, then you had better send a request to tech support.  If you want help, this is a user site and Esri staff do mingle in our midst as well.

0 Kudos
MatthewLewis
Occasional Contributor

Ok... firstly this code needs a tidy up! Split out your code and use standards, otherwise know one will want to read it and help you.

I've played around and improved the structure. I don't seem to be getting any TypeErrors

0 Kudos
joepublic
New Contributor III

Mathew,

Thanks for the quick code review and the assist. 

I agree my code is rather crude and inefficient. 

My original plan was to use esri-leaflet api but it could not handle related tables.

This api is new to me and at the moment I need to get a working version asap.

Once it done, I do plan to  figure how everything works while I clean up the code.

Will review what you sent and let you know if I have any questions

Chris

0 Kudos
MatthewLewis
Occasional Contributor

No problem, give me a shout if you need more help. I'm not always online but I try and check it regularly

0 Kudos
joepublic
New Contributor III

Mathew, et al

I tried redoing my code similar to what attaching but have encountered errors. So I am back to my original code and was able to solve the TypeError.

Now for the last part.....  I need to be able to click on the countries highlighted (based on the button clicked). Clicking on a highlighted country, triggers a query of the related table (tableURL) and the results of the query are displayed in the side panel on the right.

Can you or someone show me how I can add an  onclick event and a relatedquery to my script?

Hope what I want makes sense

0 Kudos