Page 1 of 2

Drag and Drop List

Posted: Sat Mar 17, 2012 7:32 pm
by mcgrathken.kmg

Hello

I know i put this ques out before but unfortunately I am still stuck on trying to make my list Sortable via drag n drop.
As jQuery is ported with Tiggzi i tried to use this http://jqueryui.com/demos/sortable/
but with out success.
Then i tried to use https://github.com/furf/jquery-ui-tou...
but still cant get it working.
I am at this on and for 3 weeks now and tearing my hair out.
The list is created via Parse GET method.
Any suggestions would be really appreciated.
I know Max tried to help me out but this is a general question aimed for anyone here interested to help me out or have had a similar problem.

Thanks Guys


Drag and Drop List

Posted: Tue Mar 20, 2012 7:58 pm
by maxkatz

ol
liCreate a page with a list shown, name it 'list':
Image
/li
liAdd jQuery version 1.8.7 as JavaScript file (asset):

Image
/li
liAdd another JavaScript file:
code
$(function() {
Tiggr("list").sortable();
Tiggr("list").disableSelection();
});
/code
/li
liTest the app/li
/ol


Drag and Drop List

Posted: Tue Mar 20, 2012 7:59 pm
by maxkatz

ol
liCreate a page with a list shown, name it 'list':
Image
/li
liAdd jQuery version 1.8.17 as JavaScript file (asset):

Image
/li
liAdd another JavaScript file:
code
$(function() {
Tiggr("list").sortable();
Tiggr("list").disableSelection();
});
/code
/li
liTest the app/li
/ol


Drag and Drop List

Posted: Tue Mar 20, 2012 8:04 pm
by mcgrathken.kmg

Hi Max
This is very much appreciated Max. I will try this shortly and let you know.
Will this work if the list is created from a Parse Get method.
Ken


Drag and Drop List

Posted: Tue Mar 20, 2012 9:11 pm
by maxkatz

It works with a list, shouldn't matter how it was created.


Drag and Drop List

Posted: Wed Mar 21, 2012 2:14 am
by mcgrathken.kmg

Max

Your an absolute star.
Very much appreciated.
Works like a charm.
I wasn't aware that i could add my own asset Javascript,
Hopefully it will help others.
So would the best way to update the list in Parse would be to "on success" of dropping an item to update the list via invoke the service.


Drag and Drop List

Posted: Wed Mar 21, 2012 2:38 am
by maxkatz

I think any event should work


Drag and Drop List

Posted: Sat Mar 24, 2012 12:08 am
by mcgrathken.kmg

Max
This works perfectly on my Android Xoom and Samsung Galaxy.
Is there any way i can implement this into Tiggzi ?
If you view the source it uses the following in the header

and then uses it by the following
$("#list").sortable();

I have added these scripts as assets and then a separate JavaScript using
$(function() { Tiggr("list").sortable();
Tiggr("list").disableSelection(); });

do you know what i'm doing wrong.

folks here

http://stackoverflow.com/questions/46... on-ipad-touchdevices

says that this will work on Motorola Xoom with Android 3.2 which is what i am testing it on.

Thanks Max


Drag and Drop List

Posted: Sat Mar 24, 2012 12:11 am
by mcgrathken.kmg

sorry max i forgot to add the link to the source

http://furf.com/exp/touch-punch/sorta...

it says on http://furf.com/exp/touch-punch/
to add touch events, just include the jquery.ui.touch-punch.min.js script after your jquery.ui scripts.

how to do i know which script is executed first in Tiggzi or can I add them in order.
Obviously jQuery needs to load first before touch-punch in order to work properly.
Thanks Max


Drag and Drop List

Posted: Sat Mar 24, 2012 4:59 am
by maxkatz

The scripts will be executed in order you define in Project Project Profile Resources and then any scripts defined in JavaScript file (from Create New... JavaScript).