create sub list of list item with no children

前端 未结 2 1888
后悔当初
后悔当初 2021-01-24 03:53

Little help need with jquery sortable.

I have a nested list like so:

  • root
2条回答
  •  梦毁少年i
    2021-01-24 04:28

    I have managed a work around if anyone is interested....

    instead of the over and out options I have used start and end.

    start: function(event,ui)
           {
               $(this).find('li').not(':has(ul)').append('
    '); $(this).sortable('refresh'); } , stop: function(event,ui) { $(this).find('li:empty').remove(); $(this).find('ul:empty').remove(); $(this).sortable('refresh') }

    If anyone has better solution please please please let us know...

提交回复
热议问题