View Full Version : Set values based on URL parameters?

11 Feb 2013, 1:14 PM
I have a panel view, with a bunch of components, in a JS file which is embedded in an HTML page. One of those components is a multislider, and I would like its two values to be set based on parameters passed in from a source URL.

So for example if the URL used to access the page is


then the multislider values would be set to 4 and 9 accordingly.

What is the best way to go about this?

11 Feb 2013, 1:30 PM
You can use this to grab the data from the query string:


// strip the leading ? if it exists.
var keys = Ext.Object.fromQueryString(window.location.search.substring(1));

// later
values: [keys.multi1, keys.multi2]

12 Feb 2013, 8:06 AM
Thanks Evan - got it working.

A semi-related question. I also have a grid on this page and will query a DB to populate it. Is there also a quick way within ExtJS that I can grab the query string that is built by the proxy and sent to my PHP file? i.e. programmatically grab the GET or POST data?