Hello,
Below is my what I have on my view page:
<script>
$("#myFav").sortable({
axis: 'y',
stop: function (event, ui) {
var Order = $(this).sortable('serialize').toString();
// save this Order value to the database
}
});
</scrip>
<div>
<ul id="myFav">
<li id='item_1'>Item 1</li>
<li id='item_2'>Item 2</li>
<li id='item_3'>Item 3</li>
</ul>
</div>
So how do we use this "serialize" data which is comma separated string of IDs to display the sorted list with the same order which we previously sorted on the Viewpage? Let's say I have successfully stored the serialized string to a database table so I can keep the same sorted order when open that webpage the next day. Does anyone have an example of how to use the serialized string of data on your "UL" list in your Mvc ViewPage? Please advise. Tia.
Thank you for reading this post.