Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3245331
  • 博文数量: 530
  • 博客积分: 13360
  • 博客等级: 上将
  • 技术积分: 5473
  • 用 户 组: 普通用户
  • 注册时间: 2006-07-13 13:32
文章分类

全部博文(530)

文章存档

2017年(1)

2015年(2)

2013年(24)

2012年(20)

2011年(97)

2010年(240)

2009年(117)

2008年(12)

2007年(8)

2006年(9)

分类:

2010-01-28 20:02:12

1.从JAVA后台返回的最好是List类型的数据,这个就不举例了

代码如下:

           function btn_query_click(){
               XuejiDwr.findViewByPageNumber("",1,10,
                   {
                      callback:function (data){
                           DWRUtil.removeAllRows("tb_xueji");
                        DWRUtil.addRows("tb_xueji",data['modelList'],
                            [
                                 function(model) { return model.yxsmc;},
                                 function(model) { return model.bjmc;},
                                 function(model) { return model.xh; },
                                 function(model) { return ""+model.xm+""; },
                                 function(model) { return model.ydztmc; },
                                 function(model) { return model.ydyymc; },
                                 function(model) { return model.ydrq; },
                                 function(model) {

                                     var input= document.createElement("");
                                     input.setAttribute("id","delete");
                                     input.setAttribute("value","delete");
                                    
                                     //var input = document.createElement("input");
                                     //  input.setAttribute("type", "button");
                                     //  input.setAttribute("value", "删除");
                                     //  input.setAttribute("onclick", "delInfo();");
                                       return input;

                                 }
                                
                             ],
                             {
                                 escapeHtml:false,
                                    cellCreator:function(options) { //自定义 td 的创建行为
                                    var td = document.createElement("td");
                                    td.className="InnerContent";
                                    td.align="center";
                                    return td;
                                    }
                             }
                        );
                      },
                      timeout:5000,
                        errorHandler:function(errorString, exception) {
                            alert("服务器忙或出错,请重新再试");
                        }
                   }
               );
        }

网页html代码如下

        
         
           
           
           
           
           
           
           
           
         
            
       
      
发达朝秦暮楚朝秦暮楚发达状态地原因城日期操作


阅读(2946) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~