ng-sortable trouble with data table widget

johnnyjava
Kilo Guru

I'm working on using drag and drop to re-order Release Tasks. I've cloned the Data Table widget to include ng-sortable. So far I have drag working, but the drop isn't working. I get a placeholder and no errors in my console log. Are there any angular wizards who can assist with this?

When any tr element is used as drag handle, the row appears to follow the mouse, but there's no drop shadow appearing. When I release the element, it falls back to where it came from.

drag but no drop.png

I'm attaching the widget with the ng-sortable dependencies with special thanks to ServiceNow Share item for Widget to Update Set UI Action.

I had to manually add some Order values to some of my rm_task records. Here are the widget instance properties:

sortable data table settings.PNG

1 ACCEPTED SOLUTION

It is! I was able to get it all working with some help from my A-Team.



I explain the solution we came up with here https://www.acorio.com/ui-sortable-servicenow-jakarta-widgets/


View solution in original post

8 REPLIES 8

johnnyjava
Kilo Guru

List V3 appears to be on the way out. I would not recommend putting much time at all into  a solution that requires it.

https://docs.servicenow.com/bundle/london-release-notes/page/release-notes/servicenow-platform/ui-rn.html

If you still wish to play with this, my Kingston PDI (which was upgraded from Jakarta, so who knows if yours will match exactly) has these includes related to dragdrop

/*! RESOURCE: scripts/js_includes_checklist.js */
/*! RESOURCE: /scripts/sn.dragdrop/_sn.dragdrop.js */
/*! RESOURCE: /scripts/sn.dragdrop/jquery-ui-dragdrop.min.js */

If not for list v3 can't we have it for list v2? And I'm not seeing that js include in vtb as you have shown in article

nikhil2810
Tera Contributor

Hi Johny,

I was able to make it drag and drop in html side but I'm trying to figure out code for client cintroller and server side.How should I structure $scope.erver.get you mentined in an article.

Can you please provide me with screen shot or code it'll be a great help to me.

 

Thanks,

Nikhil

Ihor
Giga Expert

Does this solution still works in current releases?(Madrid/Orlando). Can someone provide actual update set with exmaple (with actual dependencies) ?