coolite的一点东西

  //if( Test_TreeNode(row[0].ToString()+"p",nodes))
                        //{ }

 

            private bool Test_TreeNode(string Node_Id,Coolite.Ext.Web.TreeNodeCollection nodes)
            {

                //用遍历找是否存在刚要添加的node 有则不添加
                bool isNew=true;
                foreach (AsyncTreeNode node in nodes)
                {
                    if (Node_Id == node.NodeID)
                    {
                        isNew = false;
                    }               
                }
                return isNew;
            }

 

 

    <script type="text/javascript">//javascript创建tree的node并向tree添加
        function nodeLoad(node) {
            if (node.firstChild==null) {//判断是否有子结点 有则不再加载
                Coolite.AjaxMethods.NodeLoad(node.id, {
                    success: function(result) {
                        var data = eval("(" + result + ")");
                        node.loadNodes(data);
                    },
                    failure: function(errorMsg) {
                        Ext.Msg.alert('Failure', errorMsg);
                    }
                });
            }
            else {return;
            }
        }

 

原文:http://hi.baidu.com/shuijingwld9/blog/item/5e3944fa3fd69b6c034f561f.html

你可能感兴趣的:(OO)