Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
61 views
in Technique[技术] by (71.8m points)

javascript - Get array from sortable list after chaging sorting

I'm using SortableJS plugin (https://github.com/SortableJS/) for making sortable and draggable lists. Help me please, how can I get array string in input#structure from second list (#example2-right) after changing items and their positions inside?

<div id="shared-lists">
    <ul id="example2-left" class="list-group">
        <li id="1" class="list-group-item tinted">Item 1</li>
        <li id="2" class="list-group-item tinted">Item 2</li>
        <li id="3" class="list-group-item tinted">Item 3</li>
        <li id="4" class="list-group-item tinted">Item 4</li>
    </ul>
    <ul id="example2-right" class="list-group">
        <li id="1" class="list-group-item tinted">Item 1</li>
        <li id="2" class="list-group-item tinted">Item 4</li>
        <li id="3" class="list-group-item tinted">Item 2</li>
        <li id="4" class="list-group-item tinted">Item 3</li>
    </ul>
</div>
<input type="hidden" id="structure" value="1|4|2|3">
question from:https://stackoverflow.com/questions/65841798/get-array-from-sortable-list-after-chaging-sorting

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...