Page 2 of 2

Drag and drop sort list items

Posted: Mon Dec 30, 2013 9:34 pm
by Bert Vandenbogaerde

It works! Thank you!!!


Drag and drop sort list items

Posted: Mon Dec 30, 2013 9:47 pm
by Bert Vandenbogaerde

Is it normal that it does not work in the preview app from papery on iPhone?

In my browser on the mac it works fine.


Drag and drop sort list items

Posted: Mon Dec 30, 2013 10:19 pm
by Bert Vandenbogaerde

I found an interesting solution which can help others:

Since the Jquery library does not support touch based events (yet) there is a workaround for this.

It consists of two javascript files that have to be added in the project.
The files can be found on github through this link.

https://github.com/yeco/jquery-ui-tou...


Drag and drop sort list items

Posted: Mon Dec 30, 2013 11:02 pm
by Bert Vandenbogaerde

Now that this is sorted out i have a related question.

How can i map the sort order back to the database?

I would like to use the automatically generated values of the numbered list (1, 2, 3, etc...)

How do i retrieve that automatically generated value?

Thanks for the great support.


Drag and drop sort list items

Posted: Tue Dec 31, 2013 7:07 am
by Illya Stepanov

Hi Bert,

Thank you for sharing about this solution.

Now on your question: - define what kind of data you want to store in DB;

  • each element of the list can have it's attribute and have it's own element (e.g. label, or hidden label) which contains the data you want to save.
  • pass through the list preul/pre and save all the data to the array, this should help :: http://api.jquery.com/category/traver...

Drag and drop sort list items

Posted: Tue Dec 31, 2013 10:48 am
by Bert Vandenbogaerde

Hi,

I know how to write data to the database but i would like to use the automatically generated values of the numbered list (1, 2, 4)
Image

How can i retrieve those numbers to map it to the database?


Drag and drop sort list items

Posted: Tue Dec 31, 2013 11:09 am
by Oleg Danchenkov

There is no way to do this automatically. You should use js.
See http://api.jquery.com/category/traver...