我的webapp(http://jsfiddle.net/eavjd5dd/)中有这样的代码表格,但是当我发送列出的项目时,订单就像在默认情况下一样。
所以我的问题是为什么在服务器端不考虑隐藏值的新顺序......? 是否有另一个函数来调用以应用有序列表的排序......?
感谢帮助人员:)
<style>
#sortable{
-margin-left: 0;
padding-left: 0.5;
list-style-type:;
}
.ui-state-highlight{
padding: 2px;
margin: 2px;
border: 1px dashed black;
height: 20px;
}
</style>
<script>$(function(){
$("#sortable").sortable({axis: "y", placeholder: "ui-state-highlight"});
});
<script>
<form name="categoriesManagement" method="post" action="categoriesManagement.jsp">
<div class="col-sm-6 col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h4>List of categories</h4>
</div>
<div class="panel-body">
<ol id="sortable" class="ui-sortable">
<li>
<input type="hidden" name="categoryOrdering" value="9">
blabla
1
</li>
<li>
<input type="hidden" name="categoryOrdering" value="10">
blabla
2
</li>
<li>
<input type="hidden" name="categoryOrdering" value="11">
blabla
3
</li>
<li>
<input type="hidden" name="categoryOrdering" value="12">
blabla
4
</li>
<li>
<input type="hidden" name="categoryOrdering" value="13">
blabla
5
</li>
<li>
<input type="hidden" name="categoryOrdering" value="404">
blabla
6
</li>
<li>
<input type="hidden" name="categoryOrdering" value="14">
blabla
7
</li>
<li>
<input type="hidden" name="categoryOrdering" value="15">
blabla
8
</li>
<li>
<input type="hidden" name="categoryOrdering" value="17">
blabla
9
</li>
<li>
<input type="hidden" name="categoryOrdering" value="16">
blabla
10
</li>
<li>
<input type="hidden" name="categoryOrdering" value="19">
blabla
11
</li>
<li>
<input type="hidden" name="categoryOrdering" value="18">
blabla
12
</li>
<li>
<input type="hidden" name="categoryOrdering" value="21">
blabla
13
</li>
<li>
<input type="hidden" name="categoryOrdering" value="20">
blabla
14
</li>
<li>
<input type="hidden" name="categoryOrdering" value="23">
blabla
15
</li>
<li>
<input type="hidden" name="categoryOrdering" value="22">
blabla
16
</li>
<li>
<input type="hidden" name="categoryOrdering" value="25">
blabla
17
</li>
<li>
<input type="hidden" name="categoryOrdering" value="24">
blabla
18
</li>
<li>
<input type="hidden" name="categoryOrdering" value="26">
blabla
19
</li>
</ol>
</div>
<div class="panel-footer text-right">
<input type="submit" value="SAVE_CATEGORY_POSITIONING" class="showToolTipTop" title="" data-original-title="Save positioning of categories.">
</div>
</div>
</div>
</form>
答案 0 :(得分:0)
非常感谢我的朋友收藏是问题所在。我有效地将我的字符串数组转换为long[]
数组,并且效果很好。