EasyJWeb的AJAX综合示例程序及源码

来源:互联网 发布:矩阵分析 pdf 编辑:程序博客网 时间:2024/05/16 09:47

  EasyJWeb的Ajax综合示例应用于1月10号上线,这是团队2008年第一次源代码发布。该示例包括ExtJS集成、远程脚本调、Ajax表单提交等多种实例,基于EJS构架开发,持久层使用JPA及泛型DAO、业务逻辑层使用Spring2进行Bean的管理,表示层使用EasyJWeb的MVC及ExtJS等实现,示例演示了一般应用开发中的几种Ajax应用方式,欢迎大家下载交流。 

  Ajax综合示例在线演示:http://easyjweb.demo.easyjf.com/ajax2/
  Ajax综合示例War包及源码:ftp://ftp1.easyjf.com/easyjweb/demo/ajax2.war (13M)
  Ajax综合示例的源码:ftp://ftp1.easyjf.com/easyjweb/demo/ajax2-src.zip (665K)

代码摘要:

  

    Ext.BLANK_IMAGE_URL = 'plugins/extjs/ext-2.0/resources/images/default/s.gif';
Ext.onReady(
function()
    
var tree = new Ext.tree.TreePanel({   
        el:
"tree-div",   
        autoScroll:
true,
        animate:
true,
        width:
'100px',
        height:
'300px',
        enableDD:
true,
        containerScroll: 
true
        loader: 
new Ext.tree.TreeLoader({
            dataUrl:
'region.ejf?cmd=getRegion'            
        }
)
    }
);
    tree.on(
"click",function(node,event){alert(node.id);});
    tree.on(
'beforeload',function(node){        
            tree.loader.dataUrl 
= 'region.ejf?cmd=getRegion&id='+(node.id!='root'?node.id:"");
        }
);        
    
var root = new Ext.tree.AsyncTreeNode({
        text: 
'地区信息',
        draggable:
false,
        id:
'root'
    }
);
    tree.setRootNode(root);
    tree.render();
       root.expand();
}
);

示例截图:


(基于ExtJS的客户档案管理)

(一个异步加载的树)

(传统Ajax的客户档案管理)

(产品编辑)

 


 

原创粉丝点击