入图:

 

自己封装的Extjs组件GroupGrid的代码(11) 测试页面
 
自己封装的Extjs组件GroupGrid的代码(11) 测试页面
 

 


htm代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<link rel="stylesheet" type="text/css" href="../class/GroupGrid.css" />
<link rel="stylesheet" type="text/css" href="../../Client/Ext/resources/css/ext-all.css" />
<script type="text/javascript" src="../../Client/Ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../../Client/Ext/ext-all.js"></script>
<script type="text/javascript" src="../../Client/Ext/ux/ProgressBarPager.js"></script>
<script type="text/javascript" src="../../Client/Ext/ux/PagingMemoryProxy.js"></script> 
<script type="text/javascript" src="../../Client/Ext/ux/SearchField.js"></script> 
<!------------------------------------------------------------------------------------>
<script type="text/javascript" src="../class/FormatWhere.js"></script>
<script type="text/javascript" src="../class/DateField.js"></script>
<script type="text/javascript" src="../class/NumberField.js"></script>
<script type="text/javascript" src="../class/chartWidow.js"></script>
<script type="text/javascript" src="../class/GroupGrid.js"></script>
<!------------------------------------------------------------------------------------>
<script type="text/javascript" src="BaseTest_1.js"></script>   
</head>
<script  language=javascript>
window.onload=function(){        
        Ext.QuickTips.init();    
     BorrowGrid.render(Ext.getBody());
 };

</script>
<body  scroll=no>
</body>
</html>


BaseTest_1.js 代码: 

Ext.BLANK_IMAGE_URL="../../Client/Images/s.gif";      

 var cm = new Ext.grid.ColumnModel([
  new Ext.grid.CheckboxSelectionModel({handleMouseDown:Ext.emptyFn}),
 {
  header:"序号",
  dataIndex:"ID",
  width:40,
        sortable:true
 },{
  header:"借书单号",
  dataIndex:"BorrowNo",
        searchable:true,
        attribute:{type:"string"},       
        sortable:true
 },{
  header:"借书人",
  width:200,
  dataIndex:"LoginName",
        searchable:true,
        attribute:{search:true,type:"string"},   
        sortable:true
 },{
  header:"身份证",
  dataIndex:"IdentityCard",
     searchable:false,
     attribute:{type:"string"},   
        sortable:true
 },{
  header:"图书代码",
  width:70,
  dataIndex:"BCode",
  attribute:{type:"string"},  
        sortable:true
 },{
  header:"图书名称",
  dataIndex:"BName",
        sortable:true
 },{
  header:"借书时间",
  dataIndex:"BorrowDate",
  searchable:true,
  attribute:{type:"date",dateFormat:'Y-m-d'}, 
  renderer: Ext.util.Format.dateRenderer('Y-m-d'), 
        sortable:true
 },{
  header:"还书时间",
  dataIndex:"ReturnDate",
  width:70,
        sortable:true
 },{
  header:"实际还书时间",
  dataIndex:"RealReturnDate",
        sortable:true
 },{
  header:"借书数量",
  dataIndex:"BookNum",
  width:55,
  searchable:true,
  attribute:{type:"int"},   
        sortable:true
 },{
  header:"费用",
  dataIndex:"Charge",
  width:45,
  searchable:true,
  attribute:{type:"float"},   
        sortable:true
 },{
  header:"延期天数",
        width:70,
  dataIndex:"DelayDay",
  attribute:{type:"int"}, 
        sortable:true
 },{
  header:"罚款",
        width:45,
  dataIndex:"Penalty",
  attribute:{type:"float"},   
        sortable:true
 },{
  header:"总费用",
        width:55,
  dataIndex:"TotalMoney",
  attribute:{type:"float"},   
        sortable:true
 }]);

var BorrowGrid = new Ext.tet.GroupGrid({
     id:"BorrowGrid",
     pageSize:10,
  DataSourceParams:{tableName:"TestReturnBook_View",key:"ID",orderBy:"BorrowDate"},
  cm:cm,  
        autoExpandColumn:7, 
  tbar:[  
  new Ext.Toolbar.Fill(),"","-"
  ,{
   text:"添加",
   tooltip:"添加新信息",
   iconCls:"addicon"
  },"","-",{
   text:"编辑",
   tooltip:"编辑信息",
   iconCls:"editicon"
  },"","-",{
   text:"删除",
   tooltip:"删除信息",
   iconCls:"deleteicon"
  },"","-",{
      text:"查看",
   tooltip:"查看信息",
   iconCls:"lookicon"
  },"","-"],listeners:{
            'contextmenu':function(e)
            {
                e.stopEvent();
            }
  }
});

//BorrowGrid.on("rowclick",function(grid,rowIndex,e){
//    
//     alert("");

//});

相关文章:

  • 2021-12-23
  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-18
  • 2021-09-27
  • 2021-06-09
  • 2021-12-20
  • 2021-12-20
  • 2021-06-10
  • 2021-05-30
相关资源
相似解决方案