PDA

View Full Version : GeoTweet example doesn't work with an index.js using a different tab spacing?



sonwrecka
6 Aug 2010, 6:02 PM
New Sencha Touch user here, and I went through the GeoTweet example on 0.9.3, typing it in manually rather than just using the files in examples/guide. For some weird reason that I can't figure, my typed index.js had a working map, got back Twitter JSON data but had an empty timeline and no refresh button. When I replaced it with index.js from the examples/guide dir, everything worked. I did a diff on the files and there was no significant difference except that the tab spacing (converted to spaces) was 2 in mine and 4 in the working index.js.

I've attached a zip of the two index.js files -- maybe there's some difference I can't spot?

Any ideas what might be causing this?

evant
8 Aug 2010, 9:25 PM
Line 12, space between for and the =.
Line 82, the case on iconCls is wrong.

sonwrecka
9 Aug 2010, 6:18 AM
Ah, thanks Evan. Obviously these weren't "insignificant differences"! Is there a better way to debug these kind of typos than just doing a visual inspection? In other languages these would be flagged a lot more easily.

gabrielstuff
9 Aug 2010, 7:49 AM
While reading thru your script I didn't see where you were fixing the tab spacing ? Could you make some light here ?
I do not know how you could highlight your errors that Evant previously showed you.

Thank you !

gabriel

sonwrecka
9 Aug 2010, 8:40 AM
Hi gabriel -- not sure what you're asking? I made the changes that Evan mentioned on my code locally (I didn't update it on this thread?) and that resolved the problem. Personally, I think the real issue is that it's quite hard to debug this kind of problem with Sencha as is; no errors are thrown in the Javascript console. I'm hoping that maybe I just don't know about a better debugger for Sencha that would make it easier to find these errors or that one will come in time.

gabrielstuff
9 Aug 2010, 8:49 AM
In a precedent post your were talking about :

tab spacing (converted to spaces) was 2 in mine and 4 in the working index.js..

That is what I was asking. Where did you change the space between tabs ? :)

Everything is here.

Thank you for your prompt reply.