2

I am trying to get a Worklight 6.2 app JQueryMobile 1.4 mobile app working which has draggable widgets. I have included js from touchpunch http://touchpunch.furf.com/ , where I have a button that I am trying to make draggable

<script>$('#draggableButton').draggable();</script>

I was wondering if anyone had tried getting touchpunch working with Worklight/jqm or if they ended up taking some other approach to create a draggable widget. Thanks!

Jeff

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • There is also a vanilla solution that is easy to use (all you need to do is add the script): https://github.com/Bernardo-Castilho/dragdroptouch – Jos Apr 17 '18 at 08:59

1 Answers1

1

It worked for me after:

  1. adding missing jquery-ui.js
  2. adding missing class="ui-widget-content" declaration on the a href
  3. I also moved the .draggle() to wlCommonInit()

Modified HelloDraggable sample project.

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • Hi Idan, I didn't see the property 'msie' of undefined message. In the logcat, I see: 8-12 21:28:18.537: E/NONE(29312): Uncaught Exception: Uncaught TypeError: Cannot read property 'prototype' of undefined at (compiled_code):23 08-12 21:28:18.547: E/NONE(29312): Uncaught Exception: Uncaught TypeError: Object [object Object] has no method 'draggable' at (compiled_code):44 08-12 21:28:18.557: E/NONE(29312): Uncaught Exception: Uncaught TypeError: Object [object Object] has no method 'draggable' at (compiled_code):20 Thx! – JT-user2216025 Aug 14 '14 at 19:08
  • Since I did not get this error, you should provide a demo project exhibiting it. – Idan Adar Aug 14 '14 at 19:50
  • Hi Idan, Many thanks. The code can be found here: [link](https://github.com/jeffet/HelloDraggable). My apologies in advance if I did something stupid. – JT-user2216025 Aug 19 '14 at 01:34
  • Idan, Thank you! You are a star. – JT-user2216025 Aug 19 '14 at 12:12