issue 70 menu auto setting completed

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8615 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2011-07-21 02:49:07 +00:00
parent f3df85dcca
commit bfa45bfde4
12 changed files with 400 additions and 81 deletions

View file

@ -0,0 +1,44 @@
jQuery(function($){
var menuList;
var parentSrl;
var editForm = $('#editForm');
var listForm = $('#listForm');
$('button._add').click(function(){
parentSrl = $(this).parent().prevAll('._parent_key').val();
editForm.find('input[name=parent_srl]').val(parentSrl);
if(!menuList)
{
var params = new Array();
var response_tags = new Array('menuList');
exec_xml("menu","procMenuAdminAllActList", params, completeGetActList, response_tags);
}
});
function completeGetActList(obj)
{
menuList = obj.menuList;
if(menuList)
{
var menuNameList = $('#menuNameList');
for(var x in menuList)
{
var menu = menuList[x];
menuNameList.append('<option value="'+x+'">'+menu.title+'</option>');
}
}
}
$('button._parent_delete').click(function() {
var menu_item_srl = $(this).parent().prevAll('._parent_key').val();
listForm.find('input[name=menu_item_srl]').val(menu_item_srl);
listForm.submit();
});
$('button._child_delete').click(function() {
var menu_item_srl = $(this).parents('li').prevAll('._child_key').val();
listForm.find('input[name=menu_item_srl]').val(menu_item_srl);
listForm.submit();
});
});