-
23 Feb 2012 9:16 AM #1
Unanswered: Dynamic Lat/Long
Unanswered: Dynamic Lat/Long
How to replace the above lat= and lon= values with dynamic data being browser lat/long? kindly help.Code:Ext.define('AddressBook.store.Contacts', { extend: 'Ext.data.Store', config: { model: 'AddressBook.model.Contact', autoLoad: true, sorters: 'name', grouper: { groupFn: function(record) { return record.get('name')[0]; } }, proxy: { type: 'jsonp', url: 'address.php?lat=13.060416&lon=80.249634', reader: { type: 'json', rootProperty: 'results', record: 'result' } } } });
-
23 Feb 2012 11:55 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
- Answers
- 3107
You will have to use setUrl on the proxy whenever you get the lat/long coords
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
23 Feb 2012 11:56 AM #3
-
23 Feb 2012 11:57 AM #4
the reason why i posted is,
i was unable to get the browser lat/long before this data store gets executed. So I want an efficient code which will pass the geo code to the url of the proxy.
-
23 Feb 2012 12:06 PM #5Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
- Answers
- 3107
Code:var proxy = store.getProxy(); proxy.setUrl('.......');Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
23 Feb 2012 8:46 PM #6
Hi mitchelle,
Unable to track the solution. I'm just a started to sencha, never mind if i ask silly questions, kindly let me know where exactly this code has to be dropped into, inside which part in the code i mentioned.
Thanks
-
24 Feb 2012 5:26 AM #7Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
- Answers
- 3107
It would go right before you load the store.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
25 Feb 2012 6:26 PM #8
Great! That worked, but now i have another doubt, how to stop loading the store until A refresh is placed? or how to place a 'refresh' button on the top toolbar and refresh the store?


Reply With Quote