Showing posts with label ExtJS. Show all posts
Showing posts with label ExtJS. Show all posts

Saturday, October 30, 2010

Cross domain XMLHttpRequest

It's not possible to use the ArcGIS Server REST API if your parameters have more than 2048 characters and you select HTTP GET. Of course, the REST API UI provides you the option to do an HTTP POST. But how do you do this programmatically?

You use a proxy!! ArcGIS Server provides you one here. More information oh how a proxy works can be found on the Yahoo Developer Network.

I named this post Cross domain XMLHttpRequest because in the context of ExtJS, the ScriptTagProxy doesn't support HTTP POST calls. Therefore, you would use HttpProxy (with a POST method) to access the proxy on the local server. Remember to pass the parameters as properties (instead of concatenating them to the URL).

Friday, October 1, 2010

ExtJS combo doesn't allow empty text

The combo that I was using didn't allow an empty selection after picking a value from the list. Pretty strange, because another combo in the same page was working correctly. It turns out that the data store items need to have an ID greater than 1 because it seems emptyText uses ID=0.

So next time you use emptyText, make sure none of the items in your data store use an ID=0.

Monday, September 6, 2010

JavaScript MVC

This article provides a great start to implement the MVC pattern. I would argue, however, that it can be improved because it doesn't match the definition of MVC from Wikipedia.

One of the problems with the article below is that the View knows about the Controller and the Model, when it should only know about the Model. Although there is at least another problem (hint: the controller doesn't know about the View), it is very easy to fix and you get a perfect implementation of JavaScript MVC.

I am doing this with ExtJS, I'll post some code after I get it to work.