menulist增加enter键快速修改sort功能
This commit is contained in:
@@ -16,12 +16,41 @@
|
||||
$("#treeTable").treeTable({
|
||||
expandLevel : 3
|
||||
}).show();
|
||||
$("input[name=sorts]").each(function(){
|
||||
$(this).keydown(function(event){
|
||||
if(event.keyCode==13){
|
||||
$.ajax({
|
||||
type:'post',
|
||||
async:false,
|
||||
url:'${ctx}/sys/menu/updateSort',
|
||||
data:{"menuId":$(this).attr("menuId"),"sort":$(this).val()},
|
||||
success:function(data){
|
||||
if(data){
|
||||
top.$.jBox.tip("<spring:message code='update_success'/>", "<spring:message code='info'/>");
|
||||
}else{
|
||||
top.$.jBox.tip("<spring:message code='update_failed'/>", "<spring:message code='info'/>");
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
function updateSort() {
|
||||
loading('onloading...');
|
||||
$("#listForm").attr("action", "${ctx}/sys/menu/updateSort");
|
||||
$("#listForm").submit();
|
||||
}
|
||||
/* $("input[name=sorts]").each(function(){
|
||||
$(this).bind("keyup",function(event){
|
||||
alert($(this).attr("menuId"));
|
||||
alert($(this).val());
|
||||
if(event.keyCode==13){
|
||||
}
|
||||
})
|
||||
}); */
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -88,7 +117,7 @@
|
||||
<td style="text-align:center;"><shiro:hasPermission
|
||||
name="sys:menu:edit">
|
||||
<input type="hidden" name="ids" value="${menu.id}" />
|
||||
<input name="sorts" type="text" value="${menu.sort}"
|
||||
<input name="sorts" type="text" value="${menu.sort}" menuId="${menu.id}"
|
||||
style="width:50px;margin:0;padding:0;text-align:center;border: 1px solid #ddd;">
|
||||
</shiro:hasPermission>
|
||||
<shiro:lacksPermission name="sys:menu:edit">
|
||||
@@ -117,14 +146,6 @@
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
<shiro:hasPermission name="sys:menu:edit">
|
||||
<div class="form-actions pagination-left">
|
||||
<button id="btnSubmit" class="btn btn-primary" type="button"
|
||||
onclick="updateSort();">
|
||||
<spring:message code="save_sort" />
|
||||
</button>
|
||||
</div>
|
||||
</shiro:hasPermission>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user