04-16-2011 02:08 PM
I am new in BB things. I am absolutely amazed by BB PlayBook so I am trying to make some APS in PC, using webworks.
I was trying example app "Sketch Pad". Successful zipped, compiled, packaged uploaded to virtual PlayBook and testes.
1st. Problem was that there is no $(document).ready available, so i put my code to onload body .. It works
second problem is, some functions are not working, I've tried "draggable function" in jquery, in normal browser it works, but in PlayBook it don't work.
So, my question is if exist any library which is compatible, or i should write these things like draggable, fadein, fadeout and so on myself?
04-16-2011 04:24 PM
I'll answer your question in a slightly backwards way
Your best choice for an uncompicated development scenario would be Sencha Touch. While I say it's uncomplicated, I use that word as politely as I can (Sencha is well tooled but is a distaster "outside the box")
Your second (first?) choice is the far more adaptable JQuery, your quick code inserts prove you use it (so do I)
A simple test is to put an alert('boo'); directly after your ready function and see if it fires (I dount it)
The easiest test of some bug in he code is (usually) to move your ready function RIGHT to the top of code and insert few alerts so you know here the problem happens
Feel free to PM me with a proper email address if you like and I'll have a look to see what's going wrong
Hopefully you can sort it without my aid
04-16-2011 05:22 PM - edited 04-16-2011 05:24 PM
Thank you for reply, because of it, I've tried it again. Clear new application.
So, check if is document ready works, i dont know what was wrong before.
But "draggable" do not work. And i know why.
In apps, when I do not want to scroll aplication (that's what I've read) I shoud use "event.preventDefault();"
And when i add it, dragging in app (in virtual Playbook) stop working.
Here is my full code
so, how can i solve both of it. No scrolling but working dragging?
If anyone knows good material to study please write me, i was searching forum and google, i found something, but nothing ideal.
04-16-2011 05:40 PM
Now I see you code I can tell you exaclt what's wrong
The touch event and the mouse events are causing your problems
You should be VERY careful in using a touch event while we are in beta
Simply remove the touches from your app and it should work fine
I would suggest that you listen to the BB webcasts for this development process - number 3 is very good (you'll find them in devblog
To elucidate touch fires before mouse is the normal order
To overcome this you need to write a touch ebent handler - the Sketchpad demo gets you well on the way
You are now at the point where you cancontol the device completely from code
I'd give you my code that remobes these issues hapily but my code is spefically riien for a div in my app
If y9ou need some more pointers PM me