{% extends "data_list.html" %} {% block headjs%} {% endblock %} {% load i18n %} {% block addjs %} $(function(){ $("#id_op_for_tab").append(""); $("#dept_tree").treeview(); $(".div_inline").append($("#id_show_dept_data")); $(".div_inline").addClass("showDeptTree"); $("#id_op_for_tab").find("ul").eq(0).hide(); $("#id_show_dept_data").show(); $("#id_show_dept_data").find("#id_show_dept_tree").css({height:$(".dt_bdiv").height()+42}); $("#id_show_dept").click(function(){ if($(this).attr("alt")=="0") { //$(".div_inline").removeClass("cba"); $(".div_inline").addClass("showDeptTree"); $(this).attr("alt","1"); $("#id_show_dept").html(""+gettext('隐藏部门树')+""); $("#id_show_dept_data").removeClass("displayN"); $("#id_show_dept_data").show() } else { $("#id_show_dept").html(""+gettext('显示部门树')+""); $("#id_show_dept_data").addClass("displayN"); $("#id_show_dept_data").hide(); $(".div_inline").removeClass("showDeptTree"); //$(".div_inline").addClass("cba"); $(this).attr("alt","0"); } }); $("#id_spn_refresh").click(function(){ $.ajax({ type: "POST", url:"{{dbapp_url}}personnel/Department/choice_data_widget?depttree=True", dataType:"html", success:function(json){ data=json $("#dept_tree").html(data).hide(); $("#dept_tree").treeview(); $("#dept_tree").show(); } }); }); }) {% endblock %} {% load personnel_tags %} {% block addition_content %} {% endblock %}