create sub list of list item with no children

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

Little help need with jquery sortable.

I have a nested list like so:

  • root
2条回答
  •  粉色の甜心
    2021-01-24 04:34

    Actually , i don't have the same diposition of list as you , i saw inside an li you can have ul and li !

    > 
  • Academic >
      >
    • Staff
    • >
    • Courses
    • >
    >
  • i only got :

     
    • stuff ...
    • stuff ...
      • stuff ...
        • stuff ...
    • stuff ...

    in my jquery function i've got this in start :

    start: function(event,ui)
          {
         $(this).find('li').next().not('ul').after('
    '); $(this).sortable('refresh'); }

    So i manage your version to work with my list^^ , but i get i also get a droppable zone after my current element i'm dragging, so i can placemy li as children but since the parent is the element which i'm dragging, it's not possible i'd like to remove the

  • creating after my element i'm dragging and that trigger the start event !

    For the update on sort i tried and failed using serialize don't know how to get the question and it's children and order it correctly i don't know where my

  • has been drop (which parent it has , and if it's in a list with other li which place it has , beceause as you can see on the screenshot, i got a number for each item (1-2-3-4) the last one represent the order in the list which has parent id=3 you see , i've been trying for days :(

提交回复
热议问题