需求:有时在datagrid中某一列的数据比较长,比如字符地址(address)普遍都需要10多个字符,于是在datagrid中当有许多行的时候就可以通过鼠标悬停的方式可以将全称显示出来。
解决方法:
1 jQuery(function(){ 2 jQuery('#gzgi_DataGrid').datagrid({ 3 toolbar:'#tb', 4 width:1000, 5 height:480, 6 fit:true, 7 fitColumns:false, 8 nowrap: true, 9 striped: true, 10 collapsible:true, 11 scrollbarSize:0, 12 url:'<%=request.getContextPath()%>/apps/supplierInfo.do?method=json', 13 remoteSort: true, 14 singleSelect:false, 15 idField:'lSupplierId', 16 columns:[[ 17 {title:'序号',field:'startIndex', width:40,align:'center',halign:'center',sortable:false} 18 ,{title:'ck', field:'ck',checkbox:true, width:30} 19 ,{title:'<glaf:msg code="app.table.supplierinfo.ssupplierno" text="供应商编码" />',field:'sSupplierNo', width:120, halign:'center', align:'left',sortable:true} 20 ,{title:'<glaf:msg code="app.table.supplierinfo.ssuppliername" text="供应商简称" />',field:'sSupplierName', width:120, halign:'center', align:'left',sortable:true} 21 ,{title:'<glaf:msg code="app.table.supplierinfo.ssupplierfullname" text="供应商名称" />',field:'sSupplierFullName', width:120, halign:'center', align:'left',sortable:true,
formatter:function (value){ 22 return "<span title='"+value+"'>"+value+"</span>";
} 23 } 24 ,{title:'<glaf:msg code="app.table.supplierinfo.ssupplieraddress" text="公司地址" />',field:'sSupplierAddress', width:120, halign:'center', align:'left',sortable:true,
formatter:function (value){ 25 return "<span title='"+value+"'>"+value+"</span>";
}
} 26 ,{title:'<glaf:msg code="app.table.supplierinfo.idistinguish" text="供应商区分" />',field:'iDistinguish', width:80, halign:'center', align:'right',sortable:true,formatter:function(val){return getDictComBoxText(val,"distinguish");}} 27 ,{title:'<glaf:msg code="app.table.supplierinfo.isuppliertype" text="供应类别" />',field:'iSupplierType', width:80, halign:'center', align:'right',sortable:true,formatter:function(val){return getDictComBoxText(val,"supplierType");}} 28 ,{title:'<glaf:msg code="app.table.supplierinfo.ienterprisenature" text="企业性质" />',field:'iEnterpriseNature', width:80, halign:'center', align:'right',sortable:true,formatter:function(val){return getDictComBoxText(val,"enterpriseNature");}} 29 ,{title:'<glaf:msg code="app.table.supplierinfo.iisgtmc" text="GTMC共同" />',field:'iIsGtmc', width:80, halign:'center', align:'right',sortable:true,formatter:function(val){return getDictComBoxText(val,"isGtmc");}} 30 ,{title:'<glaf:msg code="app.table.supplierinfo.sbuybear" text="采购担当" />',field:'sbuyBear', width:120, halign:'center', align:'left',sortable:true} 31 ]], 32 rownumbers:false, 33 pagination:true, 34 pageSize:10, 35 pageList: [10,15,20,25,50,100] 36 }); 37 38 });
浙公网安备 33010602011771号