Drag & drop Queues page not working as a Page include

  • 1
  • Question
  • Updated 4 years ago
  • Answered
I have a drag and drop queues page built on the opportunity object that allows us to move opportunities easily through "stages" (followed this tutorial: http://help.skuidify.com/m/11720/l/217806-queue-component-custom-item-renderers ). Everything works great on this page when previewed. I then created an additional tab on our opportunity tab page to show this page via a page include and for some reason the "drop" function of the page does not work any more. Any suggestions?
Photo of Megan Vaughan

Megan Vaughan

  • 872 Points 500 badge 2x thumb

Posted 4 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Before digging too far here lets take care of the standard question:  Are any model names repeated between the opportunity page and the drag and drop detail include?  This will always cause problems.  Usually very unexpected ones. 
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
My guess is that need to change Line 23 in the Inline JavaScript resource in the tutorial (the JavaScript that makes the Queues droppable) from this:

$(function(){

to this:

$(document.body).one('pageload',function(){

This is a standard change necessary to make Skuid JavaScript code work both in regular page load scenarios as well as when loaded from Page Includes.
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
I have fixed the documentation to make the change I recommended above, and have tested that this indeed allows this page to work with or without Page Includes. I have also updated the same page XML.
Photo of Megan Vaughan

Megan Vaughan

  • 872 Points 500 badge 2x thumb
Rob- Nope that is the first thing I checked.
Photo of Megan Vaughan

Megan Vaughan

  • 872 Points 500 badge 2x thumb
Zach,

I think we are getting closer. Here is a screen shot of what I did to the JavaScript as per your comments.


Here is what happens after the above saved changes:
Photo of Megan Vaughan

Megan Vaughan

  • 872 Points 500 badge 2x thumb
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.https://na15.salesforce.com/17181/logo180.png Failed to load resource: the server responded with a status of 404 (Not Found)
OpportunityTab:54 Uncaught TypeError: Cannot read property 'is' of undefined
Photo of Megan Vaughan

Megan Vaughan

  • 872 Points 500 badge 2x thumb
yes tab set
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Try changing line 13 in the "Make queue contents droppable" Resource to be this, and see if that fixes it:

if (this.element && this.element.is && this.element.is(queueElement)) {
Photo of Megan Vaughan

Megan Vaughan

  • 872 Points 500 badge 2x thumb
SUCCESS!!! thanks so much for your help!
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Yay, glad that worked! I'll update the repository and tutorial again to add this extra piece.
Photo of Megan Vaughan

Megan Vaughan

  • 872 Points 500 badge 2x thumb