PDA

View Full Version : function, tpl and variable.



fastmap
28 Jan 2012, 8:52 PM
I have an issue with using tpl.

I have a generic function (call it "dist") that calculates the distance given two pairs of (latitude, longitude)
I have a tpl that works fine. The json returned has lat, long for each place.
However, I need to

a. Calculate distance from current location (available within the object) to (lat, long) for each store.
b. Sort the distances
c. Use the function to calculate the distance ("dist") in another tpl.

I am sure this is a recurring problem in many applications.
I would love to hear words of wisdom from Sencha Gurus.

Thanks,
fm