function jsCallInputSheetTypeTree(){

};
$(function() {
    /*确定按钮*/
    //    var fr = frameElement.dg;
    //   if(nodeId!="" && nodeName !="")
    //   {
    //               fr.addBtn('myTypeSelectorBtnSure', '确定', function() { fr.win.SetValue(nodeId,nodeName); fr.cancel(); });
    //   }
    //   else
    //   {
    //              fr.addBtn('myTypeSelectorBtnSure', '确定', function() { fr.cancel(); });    
    //   }
    /*加载表单类型树*/
    if (q("hideID") == null || q("hideID") == undefined) {
        jsCallInputSheetTypeTree.LoadData("");
    }
    else {
        jsCallInputSheetTypeTree.LoadData(q("hideID"));
    }
});
jsCallInputSheetTypeTree.CurrentSelNode=null;
var nodeId;
var nodeName;
/*单击树节点时触发的事件*/
jsCallInputSheetTypeTree.SaveCurrentNode=function(item){
     jsCallInputSheetTypeTree.CurrentSelNode=item;//用于确认按钮
     nodeId=item.id;
     nodeName=item.text;    
};

/*双击树节点时触发的事件*/
jsCallInputSheetTypeTree.GetUrl = function(item) {
    if (frameElement == null || frameElement == undefined) {
        var action = App.query("action").replace("@str", item.id + ',"' + item.text + '"');
        ShowWindow.opener.execScript(App.query("FormIndex"), action);
        ShowWindow.close();
    } else {
        frameElement.dg.win.SetValue(item.id, item.text); /*为主页面中的控件返回赋的值*/
        frameElement.dg.cancel();
    }
}


/*加载表单类型树*/
jsCallInputSheetTypeTree.LoadData = function(currNode) {
    try {
        var treeString = "";
        if (currNode != "" && currNode != undefined) {
            treeString = GetTree("select ID,CNName as Name,ParentID,EndFlag from eOA_fip_CallInputSheetType where ID<>" + currNode + " and EndFlag=0 ", "eOA_fip_CallInputSheetType", "1");
        }
        else {
            treeString = GetTree("select ID,CNName as Name,ParentID,EndFlag from eOA_fip_CallInputSheetType where EndFlag=false", "eOA_fip_CallInputSheetType", "1");
        }
        //window.clipboardData.setData("text",treeString)
        var menudata = $.parseJSON(treeString);
        var op = {
            data: menudata,
            nodedblclick: jsCallInputSheetTypeTree.GetUrl,
            foldtheme: "leaf",
            theme: "bbit-tree-no-lines",
            spacepic: "../../AppFrame/APICss/Shared/images/s.gif"
        };
        if (document.getElementById("div-left-menu-content")) {
            $("#div-left-menu-content").treeview(op);
        }
        treeString = null;
        menudata = null;
        CollectGarbage();
    }
    catch (e) {
        alert(e.message);
    }
};



