Url for json in an Grails / Extjs project

If you're using Extjs and grails togther you probably want to keep you JSON under the js directory. However in your application.js if you define regModel with a proxy and a url like;

url : 'storetestusers.json'

Your application.js won't find it in the js directory as its resolving the url relative to the gsp page, so will look in the same directory as the page.

But if you change the url to;

url : '../js/storetestusers.json'

in a default grails project this will find the json file. nice and easy!

Comments

Popular posts from this blog

Getting Started: Quick Setup for GXT 3 (includes reset.css link how to)

How to setup GXT 3 examples, samples and demos

ExtJs4 : Dynamically Add Columns